Update 91-configuration.sh

This commit is contained in:
Alexandre
2021-02-09 20:59:20 +01:00
committed by GitHub
parent b5d10e8a51
commit d2b5e1694e

View File

@@ -1,14 +1,17 @@
#!/usr/bin/with-contenv bashio
# Define preferences line
cd /config/qBittorrent/
# Clean HTTPS data
sed -i '/HTTPS/d' qBittorrent.conf
# Define preferences line
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
LINE=$[LINE + 1]
################
# SSL CONFIG #
################
# Clean data
sed -i '/HTTPS/d' qBittorrent.conf
bashio::config.require.ssl
if bashio::config.true 'ssl'; then
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
@@ -20,7 +23,24 @@ if bashio::config.true 'ssl'; then
sed -i "$LINE i\WebUI\\\HTTPS\\\KeyPath=/ssl/$KEYFILE" qBittorrent.conf
fi
bashio::log.info "Default username/password : admin/adminadmin"
################
# Alternate UI #
################
#clean data
sed -i '/AlternativeUIEnabled/d' qBittorrent.conf
if bashio::config.has_value 'customUI'; then
bashio::log.info "Alternate UI enabled. If webui don't work, disable this option"
CUSTOMUI=$(bashio::config 'customUI')
CUSTOMUI="/data/$CUSTOMUI"
sed -i "$LINE i\WebUI\\\AlternativeUIEnabled=true" qBittorrent.conf
sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUI" qBittorrent.conf
fi
################
# WHITELIST #
################
if bashio::config.has_value 'whitelist'; then
WHITELIST=$(bashio::config 'whitelist')
@@ -31,4 +51,5 @@ sed -i "$LINE i\WebUI\\\AuthSubnetWhitelist=$WHITELIST" qBittorrent.conf
bashio::log.info "Whitelisted subsets will not require a password : $WHITELIST"
fi
bashio::log.info "Default username/password : admin/adminadmin"
bashio::log.info "Configuration can be found in /config/qBittorrent"