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

47 lines
1.6 KiB
Bash

#!/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..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..."
ynh_change_url_nginx_config
# Change the path in the NGINX config file
if [ "$change_path" -eq 1 ]; then
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"
fi
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting $app's systemd service..."
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app"