2022-01-10 15:18:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
|
2022-01-10 15:18:34 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_config_change_url_nginx
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2023-11-16 11:45:51 +01:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Updating systemd service..."
|
2023-11-16 11:45:51 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_replace --match="--webroot $old_path" --replace="--webroot $new_path" --file="/etc/systemd/system/$app.service"
|
2023-11-16 12:37:49 +01:00
|
|
|
systemctl daemon-reload
|
2023-11-16 11:45:51 +01:00
|
|
|
|
2022-01-10 15:18:34 +01:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
2022-01-10 15:18:34 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Change of URL completed for $app"
|