2021-05-21 14:24:10 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-02-25 21:56:47 +01:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..."
|
2021-05-21 14:24:10 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
2024-02-25 21:56:47 +01:00
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
|
|
|
|
|
|
|
ynh_change_url_nginx_config
|
2021-05-21 14:24:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Change the path in the NGINX config file
|
2024-02-25 21:56:47 +01:00
|
|
|
if [ "$change_path" -eq 1 ]; then
|
2021-05-22 20:57:31 +02:00
|
|
|
match_string=$(echo \"BasePathOverride\": \"$old_path\")
|
|
|
|
target_string=$(echo \"BasePathOverride\": \"$new_path\")
|
2024-02-25 21:56:47 +01:00
|
|
|
sed --in-place "s@${match_string}@${target_string}@g" "$install_dir/.config/Jackett/ServerConfig.json"
|
2021-05-21 14:24:10 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-02-25 21:56:47 +01:00
|
|
|
ynh_script_progression --message="Starting $app's systemd service..."
|
2021-05-21 14:24:10 +02:00
|
|
|
|
2024-02-25 21:56:47 +01:00
|
|
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
2021-05-21 14:24:10 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-05-22 20:54:43 +02:00
|
|
|
ynh_script_progression --message="Change of URL completed for $app"
|