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