2021-02-01 14:42:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2022-05-25 18:35:13 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
|
|
|
|
2021-02-01 14:42:41 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
2023-02-26 16:31:30 +01:00
|
|
|
ynh_change_url_nginx_config
|
2021-02-01 14:42:41 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY A CONFIG FILE
|
|
|
|
#=================================================
|
2022-01-29 15:29:42 +01:00
|
|
|
ynh_script_progression --message="Reconfiguring congif file.." --weight=1
|
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
|
2022-03-02 08:28:16 +01:00
|
|
|
yes | php$phpversion 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
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
|
|
|
|
|
2021-02-01 14:42:41 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|