1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jackett_ynh.git synced 2024-09-03 19:26:28 +02:00
jackett_ynh/scripts/change_url

48 lines
1.6 KiB
Text
Raw Normal View History

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
2024-02-25 22:20:47 +01:00
jq ".BasePathOverride = \"$path\"" "$install_dir/.config/Jackett/ServerConfig.json" \
> "$install_dir/.config/Jackett/ServerConfig.json.tmp"
mv "$install_dir/.config/Jackett/ServerConfig.json.tmp" "$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"