2021-12-17 11:38:57 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-01-01 16:14:00 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=2
|
2021-12-17 11:38:57 +01:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2021-12-18 18:10:41 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2021-12-17 11:38:57 +01:00
|
|
|
|
2024-01-05 15:28:04 +01:00
|
|
|
ynh_change_url_nginx_config
|
2021-12-17 11:38:57 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2022-05-27 17:03:32 +02:00
|
|
|
# UPDATE A CONFIG FILE
|
2021-12-17 11:38:57 +01:00
|
|
|
#=================================================
|
2022-05-27 17:03:32 +02:00
|
|
|
ynh_script_progression --message="Updating a configuration file..." --weight=2
|
|
|
|
|
|
|
|
# Define armadietto module path
|
2024-01-05 15:28:04 +01:00
|
|
|
ynh_use_nodejs
|
2022-05-27 17:03:32 +02:00
|
|
|
module_path="$node_version_path/$nodejs_version/lib/node_modules/armadietto/lib"
|
|
|
|
|
2024-01-05 15:28:04 +01:00
|
|
|
ynh_add_config --template="../conf/server.js" --destination="$install_dir/server.js"
|
2022-05-27 17:03:32 +02:00
|
|
|
|
2024-01-05 15:28:04 +01:00
|
|
|
chmod 400 "$install_dir/server.js"
|
|
|
|
chown $app:$app "$install_dir/server.js"
|
2021-12-17 11:38:57 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-12-18 18:10:41 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
2021-12-17 11:38:57 +01:00
|
|
|
|
2022-05-27 17:03:32 +02:00
|
|
|
# Start a systemd service
|
2021-12-17 11:38:57 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2022-05-27 17:03:32 +02:00
|
|
|
|
2021-12-18 18:10:41 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|