1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invidious_ynh.git synced 2024-09-03 19:15:55 +02:00
This commit is contained in:
ericgaspar 2021-09-02 14:50:52 +02:00
parent 4e441a50b3
commit 1979277bee
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 21 additions and 24 deletions

View file

@ -138,14 +138,6 @@ ynh_script_progression --message="Modifying a config file..."
ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml"
chmod 600 $final_path/config/config.yml chmod 600 $final_path/config/config.yml
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/$app.timer"
ynh_add_systemd_config
#================================================= #=================================================
# SETUP CRON # SETUP CRON
#================================================= #=================================================
@ -169,6 +161,15 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log" yunohost service add $app --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log"
#=================================================
# CONFIGURE SYSTEMD TIMER
#=================================================
ynh_script_progression --message="Configuring a timer service..." --weight=1
ynh_add_config --template="../conf/systemd.timer" --destination="/etc/systemd/system/$app.timer"
systemctl enable $app.timer --quiet
systemctl start $app.timer
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
@ -176,8 +177,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path=systemd ynh_systemd_action --service_name=$app --action=start --log_path=systemd
systemctl enable $app.timer
systemctl start $app.timer
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -201,4 +200,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of Invidious completed" --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -42,6 +42,8 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
# Remove the dedicated timer systemd config
ynh_secure_remove --file="/etc/systemd/system/$app.timer"
#================================================= #=================================================
# REMOVE THE POSTGRESQL DATABASE # REMOVE THE POSTGRESQL DATABASE
@ -69,12 +71,6 @@ ynh_script_progression --message="Removing Invidious main directory..." --weight
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE SYSTEMD TIMER
#=================================================
ynh_secure_remove --file="/etc/systemd/system/$app.timer"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -100,9 +100,12 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 ynh_script_progression --message="Restoring the systemd configuration..." --weight=5
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
ynh_restore_file --origin_path="/etc/systemd/system/$app.timer"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
ynh_restore_file --origin_path="/etc/systemd/system/$app.timer"
systemctl enable $app.timer --quiet
systemctl start $app.timer
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
@ -116,8 +119,6 @@ yunohost service add $app --description="Invidious is an alternative front-end t
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd ynh_systemd_action --service_name=$app --action=start --log_path=systemd
systemctl enable $app.timer
systemctl start $app.timer
#================================================= #=================================================
# RESTORE VARIOUS FILES # RESTORE VARIOUS FILES

View file

@ -132,10 +132,13 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=2 ynh_script_progression --message="Configuring a systemd service..." --weight=2
# Create a dedicated systemd config
ynh_add_config --template="../conf/invidious.timer" --destination="/etc/systemd/system/$app.timer"
ynh_add_systemd_config ynh_add_systemd_config
# Create a dedicated timer systemd config
ynh_add_config --template="../conf/systemd.timer" --destination="/etc/systemd/system/$app.timer"
systemctl enable $app.timer --quiet
systemctl start $app.timer
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -159,8 +162,6 @@ yunohost service add $app --description="Invidious is an alternative front-end t
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd ynh_systemd_action --service_name=$app --action=restart --log_path=systemd
systemctl enable $app.timer
systemctl start $app.timer
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX