2021-02-01 14:42:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2022-05-25 18:35:13 +02:00
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_script_progression "Stopping $app's systemd service..."
|
2022-05-25 18:35:13 +02:00
|
|
|
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
|
2022-05-25 18:35:13 +02:00
|
|
|
|
2021-02-01 14:42:41 +01:00
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_script_progression "Updating NGINX web server configuration..."
|
2021-02-01 14:42:41 +01:00
|
|
|
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_config_change_url_nginx
|
2021-02-01 14:42:41 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY A CONFIG FILE
|
|
|
|
#=================================================
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_script_progression "Reconfiguring congif file.."
|
2021-02-01 14:42:41 +01:00
|
|
|
|
2022-01-29 15:29:42 +01:00
|
|
|
old_app_url_domain="https://${old_domain}${old_path%/}"
|
2021-02-01 14:42:41 +01:00
|
|
|
|
2023-02-26 16:31:30 +01:00
|
|
|
pushd $install_dir
|
2024-09-01 13:59:23 +02:00
|
|
|
yes | php$php_version artisan bookstack:update-url $old_app_url_domain https://${new_domain}${new_path}
|
2022-01-29 15:29:42 +01:00
|
|
|
popd
|
2021-02-01 14:42:41 +01:00
|
|
|
|
2023-02-26 16:31:30 +01:00
|
|
|
sed -i "/APP_URL=/c\APP_URL=https://${new_domain}${new_path}" $install_dir/.env
|
2021-02-01 14:42:41 +01:00
|
|
|
|
2022-05-25 18:35:13 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2022-05-25 18:35:13 +02:00
|
|
|
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
2022-05-25 18:35:13 +02:00
|
|
|
|
2021-02-01 14:42:41 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-09-01 13:59:23 +02:00
|
|
|
ynh_script_progression "Change of URL completed for $app"
|