chibisafe_ynh/scripts/change_url

47 lines
1.6 KiB
Text
Raw Normal View History

2017-06-02 12:46:29 -04:00
#!/bin/bash
2024-01-28 17:40:59 -05:00
## this script is only run if actual change to domain/path is detected, if you're here either $domain or $path changed
## new location is available via $domain and $path (or $new_domain and $new_path variables if you want to be explicit)
## old values are available via, you guessed it, $old_domain and $old_path
2017-06-02 12:46:29 -04:00
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-06-05 07:06:12 -04:00
source _common.sh
2017-06-02 12:46:29 -04:00
source /usr/share/yunohost/helpers
2019-05-02 14:44:22 -04:00
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
2024-06-20 17:49:43 -04:00
ynh_script_progression "Stopping $app's systemd service..."
2019-05-02 14:44:22 -04:00
2024-06-20 17:49:43 -04:00
ynh_systemctl --service="$app" --action="stop"
2019-05-02 14:44:22 -04:00
2017-06-02 12:46:29 -04:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
2024-06-20 17:49:43 -04:00
ynh_script_progression "Updating NGINX web server configuration..."
2017-06-02 12:46:29 -04:00
2024-01-28 17:40:59 -05:00
# this will most likely adjust NGINX config correctly
2024-06-20 17:49:43 -04:00
ynh_config_change_url_nginx
2017-06-02 12:46:29 -04:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
2024-01-28 17:40:59 -05:00
## do any changes to files that reference specific installation domain/path, i.e. regenerate configs etc
2019-05-02 14:44:22 -04:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
2024-06-20 17:49:43 -04:00
ynh_script_progression "Starting $app's systemd service..."
2019-05-02 14:44:22 -04:00
2024-06-20 17:49:43 -04:00
ynh_systemctl --service="$app" --action="start"
2019-05-02 14:44:22 -04:00
2019-02-10 09:02:38 -05:00
#=================================================
# END OF SCRIPT
#=================================================
2024-06-20 17:49:43 -04:00
ynh_script_progression "Change of URL completed for $app"