2022-02-10 01:09:31 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-02-27 20:19:24 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2022-02-10 01:09:31 +01:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2022-02-27 20:19:24 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2022-02-10 01:09:31 +01:00
|
|
|
|
2023-08-12 19:35:24 +02:00
|
|
|
ynh_change_url_nginx_config
|
2022-02-10 01:09:31 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2022-02-24 17:44:39 +01:00
|
|
|
# UPDATE A CONFIG FILE
|
2022-02-10 01:09:31 +01:00
|
|
|
#=================================================
|
2022-02-27 20:19:24 +01:00
|
|
|
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
2022-02-24 17:44:39 +01:00
|
|
|
|
2023-08-12 19:35:24 +02:00
|
|
|
ynh_add_config --template=".env.example" --destination="$install_dir/.env"
|
2022-02-24 17:44:39 +01:00
|
|
|
|
2023-08-12 19:35:24 +02:00
|
|
|
chmod 400 "$install_dir/.env"
|
|
|
|
chown $app:$app "$install_dir/.env"
|
2022-02-10 01:09:31 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-02-27 20:19:24 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
2022-02-10 01:09:31 +01:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-02-27 20:19:24 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|