1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mygpo_ynh.git synced 2024-09-03 19:55:52 +02:00
mygpo_ynh/scripts/change_url

54 lines
2.2 KiB
Text
Raw Normal View History

2017-06-02 18:46:29 +02:00
#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
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
#=================================================
# 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
2024-03-04 15:49:24 +01:00
mkdir -p "$env_path"
2024-03-04 16:38:59 +01:00
echo "$new_domain" > "$env_path/DEFAULT_BASE_URL"
echo "$app@$new_domain" > "$env_path/DEFAULT_FROM_EMAIL"
echo "$app@$new_domain" > "$env_path/SERVER_EMAIL"
2017-06-02 18:46:29 +02:00
set_permissions
2019-05-02 20:44:22 +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
#=================================================
2021-03-15 01:36:28 +01:00
ynh_script_progression --message="Change of URL completed for $app" --last