mirror of
https://github.com/YunoHost-Apps/jackett_ynh.git
synced 2024-09-03 19:26:28 +02:00
Fix BasePathOverride doesn't like /
This commit is contained in:
parent
6d0d955713
commit
4cc049f9d7
4 changed files with 17 additions and 7 deletions
|
@ -8,6 +8,18 @@
|
|||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
_set_BasePathOverride() {
|
||||
if [[ "$path" == "/" ]]; then
|
||||
path_or_null=null
|
||||
else
|
||||
path_or_null="\"$path\""
|
||||
fi
|
||||
|
||||
jq ".BasePathOverride = $path_or_null" "$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"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -28,9 +28,7 @@ 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"
|
||||
_set_BasePathOverride
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -45,9 +45,7 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" -
|
|||
# Start a systemd service
|
||||
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
|
||||
|
||||
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"
|
||||
_set_BasePathOverride
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
|
@ -27,11 +27,13 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
|
|||
ynh_script_progression --message="Upgrading source files..."
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=0
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".config"
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chmod -R "$app:" "$install_dir"
|
||||
|
||||
_set_BasePathOverride
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue