Files
hassio-addons/qbittorrent/rootfs/etc/cont-init.d/30-nginx.sh
2021-04-28 17:13:26 +02:00

39 lines
1.0 KiB
Bash

#!/usr/bin/with-contenv bashio
#################
# NGINX SETTING #
#################
declare admin_port
declare qbittorrent_protocol=http
# Generate Ingress configuration
if bashio::config.true 'ssl'; then
qbittorrent_protocol=https
fi
bashio::var.json \
interface "$(bashio::addon.ip_address)" \
port "^$(bashio::addon.ingress_port)" \
protocol "${qbittorrent_protocol}" \
certfile "$(bashio::config 'certfile')" \
keyfile "$(bashio::config 'keyfile')" \
ssl "^$(bashio::config 'ssl')" \
| tempio \
-template /etc/nginx/templates/ingress.gtpl \
-out /etc/nginx/servers/ingress.conf
######################
# VUETORRENT INSTALL #
######################
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)
curl -s -S -O -J -L $LATEST_RELEASE
unzip -o vuetorrent.zip -d / >/dev/null
rm /vuetorrent.zip >/dev/null