Update 30-nginx.sh

This commit is contained in:
Alexandre
2022-02-21 22:42:33 +01:00
committed by GitHub
parent 4d6195d713
commit f5d7c4840a

View File

@@ -1,6 +1,9 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
DEBUG=$(bashio::config 'TZ')
[ "$DEBUG" = "debug"] && echo "Before declare"
#################
# NGINX SETTING #
#################
@@ -8,12 +11,18 @@
#declare admin_port
declare qbittorrent_protocol=http
[ "$DEBUG" = "debug"] && echo "Before ssl"
# Generate Ingress configuration
if bashio::config.true 'ssl'; then
qbittorrent_protocol=https
fi
[ "$DEBUG" = "debug"] && echo "Before cp"
cp /etc/nginx/templates/ingress.gtpl /etc/nginx/servers/ingress.conf
[ "$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
@@ -25,12 +34,18 @@ sed -i "s|{{ .ssl }}|$(bashio::config 'ssl')|g" /etc/nginx/servers/ingress.conf
# VUETORRENT INSTALL #
######################
[ "$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"
curl -s -S -O -J -L "$LATEST_RELEASE"
[ "$DEBUG" = "debug"] && echo "Before unzip"
unzip -o vuetorrent.zip -d / >/dev/null
[ "$DEBUG" = "debug"] && echo "Before rm"
rm /vuetorrent.zip >/dev/null