2021-04-06 15:56:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-08-09 16:29:31 +02:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2021-04-06 15:56:28 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2021-08-09 16:29:31 +02:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2021-04-06 15:56:28 +02:00
|
|
|
|
2023-03-16 22:28:23 +01:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2021-09-01 10:31:34 +02:00
|
|
|
#=================================================
|
|
|
|
# CONFIGURE CONFIG.JSON FILE
|
|
|
|
#=================================================
|
2021-09-01 10:30:08 +02:00
|
|
|
|
2023-03-16 22:28:23 +01:00
|
|
|
ynh_replace_string --match_string="\"url\": \".*\"" --replace_string="\"url\": \"https://${new_domain}${new_path}\"" --target_file="$install_dir/config.json"
|
2021-09-01 10:30:08 +02:00
|
|
|
|
2021-04-06 15:56:28 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-08-09 16:29:31 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
2021-04-06 15:56:28 +02:00
|
|
|
|
2021-08-31 21:26:01 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
2021-04-06 15:56:28 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-08-09 16:29:31 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|