mirror of
https://github.com/YunoHost-Apps/deluge_ynh.git
synced 2024-09-03 18:25:52 +02:00
53 lines
1.9 KiB
Bash
Executable file
53 lines
1.9 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
upgrade_type=$(ynh_check_app_version_changed)
|
|
|
|
#=================================================
|
|
# STOP SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
|
#=================================================
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
|
|
|
ynh_add_nginx_config
|
|
|
|
ynh_add_systemd_config
|
|
ynh_add_systemd_config --service="${app}-web" --template="deluge-web.service"
|
|
|
|
yunohost service add $app --description="Lightweight BitTorrent client" --log="/var/log/$app/$app.log"
|
|
yunohost service add ${app}-web --description="BitTorrent UI" --log="/var/log/$app/$app.log"
|
|
|
|
mkdir -p /var/log/$app
|
|
chown -R $app:$app /var/log/$app
|
|
chmod -R 750 /var/log/$app
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
|
ynh_systemd_action --service_name=${app}-web --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|