mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-01 14:50:51 +02:00
lint
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
# NGINX SETTING #
|
# NGINX SETTING #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
declare admin_port
|
#declare admin_port
|
||||||
declare portainer_protocol=http
|
declare portainer_protocol=http
|
||||||
|
|
||||||
# Generate Ingress configuration
|
# Generate Ingress configuration
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# NGINX SETTING #
|
# NGINX SETTING #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
declare admin_port
|
#declare admin_port
|
||||||
declare qbittorrent_protocol=http
|
declare qbittorrent_protocol=http
|
||||||
|
|
||||||
# Generate Ingress configuration
|
# Generate Ingress configuration
|
||||||
@@ -31,6 +31,6 @@ LATEST_RELEASE=$(curl -s -L https://api.github.com/repos/wdaan/vuetorrent/releas
|
|||||||
tr -d \" |
|
tr -d \" |
|
||||||
xargs)
|
xargs)
|
||||||
|
|
||||||
curl -s -S -O -J -L $LATEST_RELEASE
|
curl -s -S -O -J -L "$LATEST_RELEASE"
|
||||||
unzip -o vuetorrent.zip -d / >/dev/null
|
unzip -o vuetorrent.zip -d / >/dev/null
|
||||||
rm /vuetorrent.zip >/dev/null
|
rm /vuetorrent.zip >/dev/null
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
##########
|
##########
|
||||||
|
|
||||||
# Define preferences line
|
# Define preferences line
|
||||||
cd /config/qBittorrent/
|
mkdir -p /config/qBittorrent
|
||||||
|
cd /config/qBittorrent/ || true
|
||||||
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
||||||
LINE=$((LINE + 1))
|
LINE=$((LINE + 1))
|
||||||
|
|
||||||
@@ -32,8 +33,8 @@ if bashio::config.has_value 'SavePath'; then
|
|||||||
#sed -i "$LINE i\Session\\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf
|
#sed -i "$LINE i\Session\\\DefaultSavePath=$DOWNLOADS" qBittorrent.conf
|
||||||
sed -i '/SavePath/d' qBittorrent.conf
|
sed -i '/SavePath/d' qBittorrent.conf
|
||||||
sed -i "$LINE i\Downloads\\\SavePath=$DOWNLOADS" qBittorrent.conf
|
sed -i "$LINE i\Downloads\\\SavePath=$DOWNLOADS" qBittorrent.conf
|
||||||
mkdir -p $DOWNLOADS || bashio::log.fatal "Error : folder defined in SavePath doesn't exist and can't be created. Check path"
|
mkdir -p "$DOWNLOADS" || bashio::log.fatal "Error : folder defined in SavePath doesn't exist and can't be created. Check path"
|
||||||
chown -R abc:abc $DOWNLOADS || bashio::log.fatal "Error, please check default save folder configuration in addon"
|
chown -R abc:abc "$DOWNLOADS" || bashio::log.fatal "Error, please check default save folder configuration in addon"
|
||||||
bashio::log.info "Downloads can be found in $DOWNLOADS"
|
bashio::log.info "Downloads can be found in $DOWNLOADS"
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -87,7 +88,7 @@ fi
|
|||||||
# WHITELIST #
|
# WHITELIST #
|
||||||
################
|
################
|
||||||
|
|
||||||
cd /config/qBittorrent/
|
cd /config/qBittorrent/ || true
|
||||||
if bashio::config.has_value 'whitelist'; then
|
if bashio::config.has_value 'whitelist'; then
|
||||||
WHITELIST=$(bashio::config 'whitelist')
|
WHITELIST=$(bashio::config 'whitelist')
|
||||||
#clean data
|
#clean data
|
||||||
@@ -101,7 +102,7 @@ fi
|
|||||||
# USERNAME #
|
# USERNAME #
|
||||||
###############
|
###############
|
||||||
|
|
||||||
cd /config/qBittorrent/
|
cd /config/qBittorrent/ || true
|
||||||
if bashio::config.has_value 'Username'; then
|
if bashio::config.has_value 'Username'; then
|
||||||
USERNAME=$(bashio::config 'Username')
|
USERNAME=$(bashio::config 'Username')
|
||||||
#clean data
|
#clean data
|
||||||
@@ -130,23 +131,23 @@ if bashio::config.has_value 'customUI'; then
|
|||||||
### Download WebUI
|
### Download WebUI
|
||||||
case $CUSTOMUI in
|
case $CUSTOMUI in
|
||||||
"vuetorrent")
|
"vuetorrent")
|
||||||
curl -s -S -J -L -o /webui/release.zip $(curl -s https://api.github.com/repos/WDaan/VueTorrent/releases/latest | grep -o "http.*vuetorrent.zip") >/dev/null
|
curl -s -S -J -L -o /webui/release.zip "$(curl -s https://api.github.com/repos/WDaan/VueTorrent/releases/latest | grep -o "http.*vuetorrent.zip")" >/dev/null
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"qbit-matUI")
|
"qbit-matUI")
|
||||||
curl -s -S -J -L -o /webui/release.zip $(curl -s https://api.github.com/repos/bill-ahmed/qbit-matUI/releases/latest | grep -o "http.*Unix.*.zip") >/dev/null
|
curl -s -S -J -L -o /webui/release.zip "$(curl -s https://api.github.com/repos/bill-ahmed/qbit-matUI/releases/latest | grep -o "http.*Unix.*.zip")" >/dev/null
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"qb-web")
|
"qb-web")
|
||||||
curl -s -S -J -L -o /webui/release.zip $(curl -s https://api.github.com/repos/CzBiX/qb-web/releases | grep -o "http.*qb-web-.*zip") >/dev/null
|
curl -s -S -J -L -o /webui/release.zip "$(curl -s https://api.github.com/repos/CzBiX/qb-web/releases | grep -o "http.*qb-web-.*zip")" >/dev/null
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
### Install WebUI
|
### Install WebUI
|
||||||
mkdir -p /webui/$CUSTOMUI
|
mkdir -p /webui/"$CUSTOMUI"
|
||||||
unzip -q /webui/release.zip -d /webui/$CUSTOMUI
|
unzip -q /webui/release.zip -d /webui/"$CUSTOMUI"
|
||||||
rm /webui/*.zip
|
rm /webui/*.zip
|
||||||
CUSTOMUIDIR="$(dirname "$(find /webui/$CUSTOMUI -iname "public" -type d)")"
|
CUSTOMUIDIR="$(dirname "$(find /webui/"$CUSTOMUI" -iname "public" -type d)")"
|
||||||
# Set qbittorrent
|
# Set qbittorrent
|
||||||
sed -i "$LINE i\WebUI\\\AlternativeUIEnabled=true" /config/qBittorrent/qBittorrent.conf
|
sed -i "$LINE i\WebUI\\\AlternativeUIEnabled=true" /config/qBittorrent/qBittorrent.conf
|
||||||
sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUIDIR" /config/qBittorrent/qBittorrent.conf
|
sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUIDIR" /config/qBittorrent/qBittorrent.conf
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
|
|
||||||
QBT_CONFIG_FILE="/config/qBittorrent/qBittorrent.conf"
|
QBT_CONFIG_FILE="/config/qBittorrent/qBittorrent.conf"
|
||||||
# Define preferences line
|
# Define preferences line
|
||||||
cd /config/qBittorrent/
|
cd /config/qBittorrent/ || exit 1
|
||||||
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
||||||
LINE=$((LINE + 1))
|
LINE=$((LINE + 1))
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ else
|
|||||||
# REMOVE OPENVPN #
|
# REMOVE OPENVPN #
|
||||||
##################
|
##################
|
||||||
# Ensure no redirection by removing the direction tag
|
# Ensure no redirection by removing the direction tag
|
||||||
cd /config/qBittorrent/
|
cd /config/qBittorrent/ || exit 1
|
||||||
sed -i '/Interface/d' qBittorrent.conf
|
sed -i '/Interface/d' qBittorrent.conf
|
||||||
bashio::log.info "Direct connection without VPN enabled"
|
bashio::log.info "Direct connection without VPN enabled"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# shellcheck disable=SD2154,SC2004,SC2059,SC2086
|
||||||
# Copyright (c) 2006-2007 Gentoo Foundation
|
# Copyright (c) 2006-2007 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
# Contributed by Roy Marples (uberlord@gentoo.org)
|
# Contributed by Roy Marples (uberlord@gentoo.org)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# shellcheck disable=SD2154,SC2004,SC2059,SC2086
|
||||||
|
|
||||||
# launch qbittorrent
|
# launch qbittorrent
|
||||||
/etc/openvpn/up-qbittorrent.sh "${4}" &
|
/etc/openvpn/up-qbittorrent.sh "${4}" &
|
||||||
|
|||||||
Reference in New Issue
Block a user