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 14:11:16 +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 11:43:36 +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 11:43:36 +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 14:11:16 +01:00
|
|
|
url_path=${new_path#/}
|
2020-11-19 21:41:03 +01:00
|
|
|
|
2024-05-28 23:31:51 +02:00
|
|
|
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json"
|
2020-11-19 21:41:03 +01:00
|
|
|
|
2023-04-03 11:43:36 +02:00
|
|
|
chmod 400 "$install_dir/config.json"
|
|
|
|
chown $app:$app "$install_dir/config.json"
|
2022-02-01 14:11:16 +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-12 22:47:43 +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 14:11:16 +01:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|