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

40 lines
1.3 KiB
Text
Raw Permalink Normal View History

2022-01-10 15:18:34 +01:00
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
2022-01-10 15:18:34 +01:00
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
2022-01-10 15:18:34 +01:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression "Updating NGINX web server configuration..."
2022-01-10 15:18:34 +01:00
ynh_config_change_url_nginx
2022-01-10 15:18:34 +01:00
2023-11-16 11:45:51 +01:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
ynh_script_progression "Updating systemd service..."
2023-11-16 11:45:51 +01:00
ynh_replace --match="--webroot $old_path" --replace="--webroot $new_path" --file="/etc/systemd/system/$app.service"
2023-11-16 12:37:49 +01:00
systemctl daemon-reload
2023-11-16 11:45:51 +01:00
2022-01-10 15:18:34 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
2022-01-10 15:18:34 +01:00
ynh_systemctl --service=$app --action="start" --log_path="systemd"
2022-01-10 15:18:34 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Change of URL completed for $app"