2019-05-29 00:20:58 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2020-08-29 15:07:15 +02:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2019-05-29 00:20:58 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-10-16 10:50:34 +02:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
2019-05-29 00:20:58 +02:00
|
|
|
|
2024-01-24 12:25:21 +01:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2019-05-29 00:20:58 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2020-04-01 19:19:56 +02:00
|
|
|
# ALTERED NODERED SETTINGS FILE
|
2019-05-29 00:20:58 +02:00
|
|
|
#=================================================
|
|
|
|
|
2024-01-24 12:38:53 +01:00
|
|
|
chmod 660 "$install_dir/data/settings.js"
|
|
|
|
ynh_add_config --template="settings.js" --destination="$install_dir/data/settings.js"
|
2020-04-01 19:19:56 +02:00
|
|
|
|
2024-01-24 12:38:53 +01:00
|
|
|
chown "$app:" "$install_dir/data/settings.js"
|
|
|
|
chmod 400 "$install_dir/data/settings.js"
|
2021-06-09 21:32:34 +02:00
|
|
|
|
2019-05-29 00:20:58 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2020-08-29 15:07:15 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
2019-05-29 00:20:58 +02:00
|
|
|
|
2022-01-27 00:17:52 +01:00
|
|
|
# Start a systemd service
|
2024-01-24 12:38:53 +01:00
|
|
|
ynh_systemd_action --service_name="$app" --action="start"
|
2019-05-29 00:20:58 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-01-27 00:17:52 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|