2021-04-06 15:56:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
2021-04-06 15:56:28 +02:00
|
|
|
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_systemctl --service=$app --action="stop"
|
2021-04-06 15:56:28 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
2021-04-06 15:56:28 +02:00
|
|
|
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_config_change_url_nginx
|
2023-03-16 22:28:23 +01:00
|
|
|
|
2021-09-01 10:31:34 +02:00
|
|
|
#=================================================
|
|
|
|
# CONFIGURE CONFIG.JSON FILE
|
|
|
|
#=================================================
|
2021-09-01 10:30:08 +02:00
|
|
|
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_replace --match="\"url\": \".*\"" --replace="\"url\": \"https://${new_domain}${new_path}\"" --file="$install_dir/config.json"
|
2021-09-01 10:30:08 +02:00
|
|
|
|
2021-04-06 15:56:28 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2021-04-06 15:56:28 +02:00
|
|
|
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
2021-04-06 15:56:28 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-06-24 14:16:00 +02:00
|
|
|
ynh_script_progression "Change of URL completed for $app"
|