2019-05-20 19:16:54 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-07-04 00:15:21 +02:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=2
|
2019-05-20 19:16:54 +02:00
|
|
|
|
2023-10-04 08:35:00 +02:00
|
|
|
ynh_systemd_action --service_name=transmission-daemon --action="stop" --log_path="systemd"
|
2019-05-20 19:16:54 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2020-12-14 11:36:02 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
2019-05-20 19:16:54 +02:00
|
|
|
|
2023-09-28 12:25:27 +02:00
|
|
|
ynh_change_url_nginx_config
|
2019-05-20 19:16:54 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# UPDATE TRANSMISSION CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2023-12-06 11:24:08 +01:00
|
|
|
ynh_backup_if_checksum_is_different --file="$SETTINGS_FILE"
|
2022-07-03 20:36:04 +02:00
|
|
|
|
2023-12-06 11:24:08 +01:00
|
|
|
ynh_replace_string --match_string="rpc-url\": \"${old_path%/}/transmission/" --replace_string="rpc-url\": \"${new_path%/}/transmission/" --target_file="$SETTINGS_FILE"
|
2019-05-20 19:16:54 +02:00
|
|
|
|
2023-12-06 11:24:08 +01:00
|
|
|
ynh_store_file_checksum --file="$SETTINGS_FILE"
|
2022-07-03 20:36:04 +02:00
|
|
|
|
2019-05-20 19:16:54 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2022-07-04 00:15:21 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
2019-05-20 19:16:54 +02:00
|
|
|
|
2023-10-04 08:35:00 +02:00
|
|
|
ynh_systemd_action --service_name=transmission-daemon --action="start" --log_path="systemd"
|
2019-05-20 19:16:54 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|