2022-12-29 12:41:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
2023-04-19 15:51:18 +02:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2023-04-19 11:40:14 +02:00
|
|
|
#=================================================
|
|
|
|
# CHANGE APP CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Changing app configuration file..." --weight=1
|
2023-04-19 15:59:57 +02:00
|
|
|
|
2023-04-19 12:30:10 +02:00
|
|
|
domain="$old_domain"
|
|
|
|
|
2024-05-10 23:19:58 +02:00
|
|
|
ynh_add_config --template=".env.local.example" --destination="$install_dir/.env.local"
|
2023-04-19 11:40:14 +02:00
|
|
|
|
2023-04-19 15:51:18 +02:00
|
|
|
chmod 400 "$install_dir/.env.local"
|
|
|
|
chown $app:$app "$install_dir/.env.local"
|
2023-04-19 11:40:14 +02:00
|
|
|
|
2022-12-29 12:41:54 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|