mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-09 17:15:57 +02:00
Update 30-nginx.sh
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
DEBUG=$(bashio::config 'TZ')
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before declare"
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# NGINX SETTING #
|
# NGINX SETTING #
|
||||||
#################
|
#################
|
||||||
@@ -8,12 +11,18 @@
|
|||||||
#declare admin_port
|
#declare admin_port
|
||||||
declare qbittorrent_protocol=http
|
declare qbittorrent_protocol=http
|
||||||
|
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before ssl"
|
||||||
|
|
||||||
# Generate Ingress configuration
|
# Generate Ingress configuration
|
||||||
if bashio::config.true 'ssl'; then
|
if bashio::config.true 'ssl'; then
|
||||||
qbittorrent_protocol=https
|
qbittorrent_protocol=https
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before cp"
|
||||||
|
|
||||||
cp /etc/nginx/templates/ingress.gtpl /etc/nginx/servers/ingress.conf
|
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|{{ .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|{{ .port }}|$(bashio::addon.ingress_port)|g" /etc/nginx/servers/ingress.conf
|
||||||
sed -i "s|{{ .protocol }}|${qbittorrent_protocol}|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 #
|
# VUETORRENT INSTALL #
|
||||||
######################
|
######################
|
||||||
|
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before var"
|
||||||
LATEST_RELEASE=$(curl -s -L https://api.github.com/repos/wdaan/vuetorrent/releases/latest |
|
LATEST_RELEASE=$(curl -s -L https://api.github.com/repos/wdaan/vuetorrent/releases/latest |
|
||||||
grep "browser_download_url.*zip" |
|
grep "browser_download_url.*zip" |
|
||||||
cut -d : -f 2,3 |
|
cut -d : -f 2,3 |
|
||||||
tr -d \" |
|
tr -d \" |
|
||||||
xargs)
|
xargs)
|
||||||
|
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before curl"
|
||||||
curl -s -S -O -J -L "$LATEST_RELEASE"
|
curl -s -S -O -J -L "$LATEST_RELEASE"
|
||||||
|
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before unzip"
|
||||||
unzip -o vuetorrent.zip -d / >/dev/null
|
unzip -o vuetorrent.zip -d / >/dev/null
|
||||||
|
|
||||||
|
[ "$DEBUG" = "debug"] && echo "Before rm"
|
||||||
rm /vuetorrent.zip >/dev/null
|
rm /vuetorrent.zip >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user