mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Update 91-configuration.sh
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
cd /config/qBittorrent/
|
||||
|
||||
# Clean HTTPS data
|
||||
sed -i '/HTTPS/d' /config/qBittorrent/qBittorrent.conf
|
||||
sed -i '/HTTPS/d' qBittorrent.conf
|
||||
|
||||
# Define preferences line
|
||||
LINE=$(sed -n '/Preferences/=' /config/qBittorrent/qBittorrent.conf)
|
||||
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
||||
LINE=$[LINE + 1]
|
||||
|
||||
bashio::config.require.ssl
|
||||
@@ -12,15 +14,10 @@ if bashio::config.true 'ssl'; then
|
||||
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
|
||||
#set variables
|
||||
CERTFILE=$(bashio::config 'certfile')
|
||||
KEYFILE=$(bashio::config 'keyfile')
|
||||
#Check if certificates exist
|
||||
#if [ bashio::fs.file_exists "/ssl/$CERTFILE" ] && [ bashio::fs.file_exists "/ssl/$KEYFILE" ]; then
|
||||
cd /config/qBittorrent
|
||||
KEYFILE=$(bashio::config 'keyfile')
|
||||
sed -i "$LINE i\WebUI\\\HTTPS\\\Enabled=True" qBittorrent.conf
|
||||
sed -i "$LINE i\WebUI\\\HTTPS\\\CertificatePath=/ssl/$CERTFILE" qBittorrent.conf
|
||||
sed -i "$LINE i\WebUI\\\HTTPS\\\KeyPath=/ssl/$KEYFILE" qBittorrent.conf
|
||||
#else bashio::log.error "Certificates not found in $CERTFILE and/or $KEYFILE"
|
||||
#fi
|
||||
fi
|
||||
|
||||
bashio::log.info "Default username/password : admin/adminadmin"
|
||||
@@ -28,8 +25,7 @@ bashio::log.info "Default username/password : admin/adminadmin"
|
||||
if bashio::config.has_value 'whitelist'; then
|
||||
WHITELIST=$(bashio::config 'whitelist')
|
||||
#clean data
|
||||
cd /config/qBittorrent
|
||||
sed -i '/AuthSubnetWhitelist/d' /config/qBittorrent/qBittorrent.conf
|
||||
sed -i '/AuthSubnetWhitelist/d' qBittorrent.conf
|
||||
sed -i "$LINE i\WebUI\\\AuthSubnetWhitelistEnabled=true" qBittorrent.conf
|
||||
sed -i "$LINE i\WebUI\\\AuthSubnetWhitelist=$WHITELIST" qBittorrent.conf
|
||||
bashio::log.info "Whitelisted subsets will not require a password : $WHITELIST"
|
||||
|
||||
Reference in New Issue
Block a user