Update 30-nginx.sh

This commit is contained in:
Alexandre
2022-02-21 22:45:50 +01:00
committed by GitHub
parent f5d7c4840a
commit 7a9a615c78

View File

@@ -2,7 +2,7 @@
# shellcheck shell=bash
DEBUG=$(bashio::config 'TZ')
[ "$DEBUG" = "debug"] && echo "Before declare"
[ "$DEBUG" = "debug" ] && echo "Before declare"
#################
# NGINX SETTING #
@@ -11,18 +11,18 @@ DEBUG=$(bashio::config 'TZ')
#declare admin_port
declare qbittorrent_protocol=http
[ "$DEBUG" = "debug"] && echo "Before ssl"
[ "$DEBUG" = "debug" ] && echo "Before ssl"
# Generate Ingress configuration
if bashio::config.true 'ssl'; then
qbittorrent_protocol=https
fi
[ "$DEBUG" = "debug"] && echo "Before cp"
[ "$DEBUG" = "debug" ] && echo "Before cp"
cp /etc/nginx/templates/ingress.gtpl /etc/nginx/servers/ingress.conf
[ "$DEBUG" = "debug"] && echo "Before sed"
[ "$DEBUG" = "debug" ] && echo "Before sed"
sed -i "s|{{ .interface }}|$(bashio::addon.ip_address)|g" /etc/nginx/servers/ingress.conf
sed -i "s|{{ .port }}|$(bashio::addon.ingress_port)|g" /etc/nginx/servers/ingress.conf
sed -i "s|{{ .protocol }}|${qbittorrent_protocol}|g" /etc/nginx/servers/ingress.conf
@@ -34,18 +34,18 @@ sed -i "s|{{ .ssl }}|$(bashio::config 'ssl')|g" /etc/nginx/servers/ingress.conf
# VUETORRENT INSTALL #
######################
[ "$DEBUG" = "debug"] && echo "Before var"
[ "$DEBUG" = "debug" ] && echo "Before var"
LATEST_RELEASE=$(curl -s -L https://api.github.com/repos/wdaan/vuetorrent/releases/latest |
grep "browser_download_url.*zip" |
cut -d : -f 2,3 |
tr -d \" |
xargs)
[ "$DEBUG" = "debug"] && echo "Before curl"
[ "$DEBUG" = "debug" ] && echo "Before curl"
curl -s -S -O -J -L "$LATEST_RELEASE"
[ "$DEBUG" = "debug"] && echo "Before unzip"
[ "$DEBUG" = "debug" ] && echo "Before unzip"
unzip -o vuetorrent.zip -d / >/dev/null
[ "$DEBUG" = "debug"] && echo "Before rm"
[ "$DEBUG" = "debug" ] && echo "Before rm"
rm /vuetorrent.zip >/dev/null