2020-11-19 21:41:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|
|
|
|
2022-02-01 15:51:28 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
|
2020-11-19 21:41:03 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
2023-04-03 13:57:06 +02:00
|
|
|
ynh_change_url_nginx_config
|
2020-11-19 21:41:03 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
2020-11-19 21:56:06 +01:00
|
|
|
# CONFIGURE HEDGEDOC
|
2020-11-19 21:41:03 +01:00
|
|
|
#=================================================
|
|
|
|
|
2023-04-03 13:57:06 +02:00
|
|
|
ynh_backup_if_checksum_is_different --file="$install_dir/config.json"
|
2020-11-19 21:41:03 +01:00
|
|
|
|
|
|
|
domain=$new_domain
|
2022-02-01 15:51:28 +01:00
|
|
|
url_path=${new_path#/}
|
2020-11-19 21:41:03 +01:00
|
|
|
|
2023-04-03 13:57:06 +02:00
|
|
|
ynh_add_config --template="../conf/config.json.example" --destination="$install_dir/config.json"
|
2020-11-19 21:41:03 +01:00
|
|
|
|
2023-04-03 13:57:06 +02:00
|
|
|
chmod 400 "$install_dir/config.json"
|
|
|
|
chown $app:$app "$install_dir/config.json"
|
2022-02-01 15:51:28 +01:00
|
|
|
|
2020-11-19 21:41:03 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
|
|
|
# Start a systemd service
|
2021-03-21 20:58:48 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
|
2020-11-19 21:41:03 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-02-01 15:51:28 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|