2017-12-05 19:33:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-05-20 20:55:15 +02:00
|
|
|
#=================================================
|
|
|
|
# ACTIVATE MAINTENANCE MODE
|
|
|
|
#=================================================
|
|
|
|
|
2023-04-16 17:12:12 +02:00
|
|
|
path=$old_path
|
2018-05-20 20:55:15 +02:00
|
|
|
domain=$old_domain
|
2017-12-05 19:33:47 +01:00
|
|
|
|
2023-04-16 17:12:12 +02:00
|
|
|
ynh_maintenance_mode_ON
|
2017-12-05 19:33:47 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
2022-06-23 08:54:56 +02:00
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop"
|
|
|
|
|
2017-12-05 19:33:47 +01:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-10-05 22:02:46 +02:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
2017-12-05 19:33:47 +01:00
|
|
|
|
2023-04-16 17:12:12 +02:00
|
|
|
ynh_change_url_nginx_config
|
2017-12-05 19:33:47 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# REPLACE THE PATH IN THE CONFIG OF LUTIM
|
|
|
|
#=================================================
|
|
|
|
|
2023-04-16 17:12:12 +02:00
|
|
|
ynh_replace_string --match_string="\(^ *prefix.*=> '\).*" --replace_string="\1$new_path'," --target_file="$install_dir/lutim.conf"
|
2017-12-05 19:33:47 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
2022-06-23 08:54:56 +02:00
|
|
|
# START SYSTEMD SERVICE
|
2017-12-05 19:33:47 +01:00
|
|
|
#=================================================
|
2022-06-23 08:54:56 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
2017-12-05 19:33:47 +01:00
|
|
|
|
2022-06-23 08:54:56 +02:00
|
|
|
# Start a systemd service
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --line_match="Manager.*started" --log_path="/var/log/$app/production.log" --timeout="120"
|
2018-05-20 20:55:15 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DEACTIVE MAINTENANCE MODE
|
|
|
|
#=================================================
|
|
|
|
|
2023-04-16 17:12:12 +02:00
|
|
|
path=$old_path
|
2018-05-20 20:55:15 +02:00
|
|
|
domain=$old_domain
|
|
|
|
ynh_maintenance_mode_OFF
|
2019-01-30 16:19:40 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-11-12 15:30:00 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|