2020-11-19 21:41:03 +01:00
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
2024-09-01 12:45:48 +02:00
ynh_script_progression "Stopping $app's systemd service..."
2020-11-19 21:41:03 +01:00
2024-09-01 12:45:48 +02:00
ynh_systemctl --service=$app --action=stop --log_path=systemd
2020-11-19 21:41:03 +01:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
2024-09-01 12:45:48 +02:00
ynh_script_progression "Updating NGINX web server configuration..."
2020-11-19 21:41:03 +01:00
2024-09-01 12:45:48 +02:00
ynh_config_change_url_nginx
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
#=================================================
2024-09-01 12:45:48 +02:00
ynh_backup_if_checksum_is_different "$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
2024-09-01 12:45:48 +02:00
ynh_config_add --template="config.json.example" --destination="$install_dir/config.json"
2020-11-19 21:41:03 +01:00
2024-09-01 12:45:48 +02:00
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.json"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.json"
2022-02-01 15:51:28 +01:00
2020-11-19 21:41:03 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
2024-09-01 12:45:48 +02:00
ynh_script_progression "Starting $app's systemd service..."
2020-11-19 21:41:03 +01:00
# Start a systemd service
2024-09-01 12:45:48 +02:00
ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening"
2020-11-19 21:41:03 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2024-09-01 12:45:48 +02:00
ynh_script_progression "Change of URL completed for $app"