2021-11-18 14:46:45 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
2022-01-30 10:37:53 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
2021-11-18 14:46:45 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
2023-03-02 22:25:13 +01:00
|
|
|
ynh_change_url_nginx_config
|
2021-11-18 14:46:45 +01:00
|
|
|
|
2022-07-08 08:43:17 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating systemd service..." --weight=1
|
|
|
|
|
2023-08-27 07:48:19 +02:00
|
|
|
ynh_replace_string --match_string="Environment=ROOT_URL=https://$old_domain" --replace_string="Environment=ROOT_URL=https://$new_domain" --target_file="/etc/systemd/system/$app.service"
|
2022-07-08 09:10:12 +02:00
|
|
|
systemctl daemon-reload
|
2022-07-08 08:43:17 +02:00
|
|
|
|
2021-11-18 14:46:45 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-10-01 19:11:02 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=16
|
2021-11-18 14:46:45 +01:00
|
|
|
|
2022-06-26 20:30:44 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="SERVER RUNNING"
|
2021-11-18 14:46:45 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|