1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ssbroom_ynh.git synced 2024-09-03 20:26:29 +02:00
ssbroom_ynh/scripts/change_url

50 lines
1.7 KiB
Text
Raw Normal View History

2021-09-08 10:52:58 +02:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
2021-10-08 13:13:32 +02:00
ynh_script_progression --message="Stopping a systemd service..." --weight=1
2021-09-08 10:52:58 +02:00
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
2021-10-08 13:13:32 +02:00
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
2021-09-08 10:52:58 +02:00
2024-01-06 00:11:26 +01:00
ynh_change_url_nginx_config
2021-10-06 12:35:46 +02:00
# Change the domain for NGINX
if [ $change_domain -eq 1 ]
then
2024-01-06 00:11:26 +01:00
# replace domain in systemd service file
ynh_replace_string --match_string=$old_domain --replace_string=$new_domain --target_file=/etc/systemd/system/$app.service
systemctl daemon-reload
2021-10-06 12:35:46 +02:00
fi
2021-09-08 10:52:58 +02:00
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
2021-10-08 13:13:32 +02:00
ynh_script_progression --message="Starting a systemd service..." --weight=1
2021-09-08 10:52:58 +02:00
2022-07-02 19:06:02 +02:00
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="event=serving"
2021-09-08 10:52:58 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2021-10-08 13:13:32 +02:00
ynh_script_progression --message="Change of URL completed for $app" --last