2023-10-05 15:34:34 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2023-10-06 14:19:55 +02:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2023-10-05 15:34:34 +02:00
|
|
|
|
2023-10-06 14:19:55 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
2023-10-05 15:34:34 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2023-10-06 14:19:55 +02:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2023-10-05 15:34:34 +02:00
|
|
|
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2023-10-05 18:35:16 +02:00
|
|
|
if [ $change_path -eq 1 ]
|
|
|
|
then
|
|
|
|
if [ "$new_path" = "/" ]; then
|
|
|
|
conf_path=""
|
|
|
|
else
|
|
|
|
conf_path=$new_path
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
conf_path=$path
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $change_domain -eq 1 ]
|
|
|
|
then
|
|
|
|
domain=$new_domain
|
2023-10-05 17:03:27 +02:00
|
|
|
fi
|
|
|
|
|
2023-10-05 15:34:34 +02:00
|
|
|
ynh_add_config -t default.json -d "$install_dir/config/default.json"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression -m "Starting the systemd service..." -w 1
|
|
|
|
|
|
|
|
ynh_systemd_action -a start
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression -m "Change of URL completed for $app" -l
|