2017-06-02 18:46:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2022-02-02 21:42:33 +01:00
|
|
|
|
2017-06-05 13:06:12 +02:00
|
|
|
source _common.sh
|
2017-06-02 18:46:29 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2019-05-02 20:44:22 +02:00
|
|
|
#=================================================
|
2021-04-27 22:37:37 +02:00
|
|
|
# STOP SYSTEMD SERVICES
|
2019-05-02 20:44:22 +02:00
|
|
|
#=================================================
|
2024-03-04 15:42:05 +01:00
|
|
|
ynh_script_progression --message="Stopping $app's systemd services..." --weight=1
|
2019-05-02 20:44:22 +02:00
|
|
|
|
2024-03-04 15:42:05 +01:00
|
|
|
ynh_systemd_action --service_name="$app-celery" --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
ynh_systemd_action --service_name="$app-beat" --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
ynh_systemd_action --service_name="$app.socket" --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
|
2019-05-02 20:44:22 +02:00
|
|
|
|
2017-06-02 18:46:29 +02:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2021-03-15 01:36:28 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
2017-06-02 18:46:29 +02:00
|
|
|
|
2024-03-04 12:04:56 +01:00
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
2017-06-02 18:46:29 +02:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2024-03-04 15:42:05 +01:00
|
|
|
ynh_script_progression --message="Updating $app's configuration files..." --weight=1
|
|
|
|
|
|
|
|
echo "$new_domain" > "$env_path/envs/prod/DEFAULT_BASE_URL"
|
|
|
|
echo "$app@$new_domain" > "$env_path/envs/prod/DEFAULT_FROM_EMAIL"
|
|
|
|
echo "$app@$new_domain" > "$env_path/envs/prod/SERVER_EMAIL"
|
2017-06-02 18:46:29 +02:00
|
|
|
|
2021-04-27 22:37:37 +02:00
|
|
|
set_permissions
|
|
|
|
|
2019-05-02 20:44:22 +02:00
|
|
|
#=================================================
|
2021-04-27 22:37:37 +02:00
|
|
|
# START SYSTEMD SERVICES
|
2019-05-02 20:44:22 +02:00
|
|
|
#=================================================
|
2021-03-15 01:36:28 +01:00
|
|
|
ynh_script_progression --message="Starting systemd services..." --weight=1
|
2019-05-02 20:44:22 +02:00
|
|
|
|
2024-03-04 15:42:05 +01:00
|
|
|
ynh_systemd_action --service_name="$app.socket" --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
ynh_systemd_action --service_name="$app-celery" --action="start" --log_path="/var/log/$app/$app.log"
|
|
|
|
ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="/var/log/$app/$app.log"
|
2019-02-10 15:02:38 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2022-02-02 21:42:33 +01:00
|
|
|
|
2021-03-15 01:36:28 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|