mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-22 23:36:05 +02:00
Update 91-configuration.sh
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
|
|
||||||
#clean HTTPS data
|
# Clean HTTPS data
|
||||||
sed -i '/HTTPS/d' /config/qBittorrent/qBittorrent.conf
|
sed -i '/HTTPS/d' /config/qBittorrent/qBittorrent.conf
|
||||||
|
|
||||||
|
# Define preferences line
|
||||||
|
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
||||||
|
LINE=$[LINE + 1]
|
||||||
|
|
||||||
bashio::config.require.ssl
|
bashio::config.require.ssl
|
||||||
if bashio::config.true 'ssl'; then
|
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"
|
||||||
@@ -12,8 +16,6 @@ if bashio::config.true 'ssl'; then
|
|||||||
#Check if certificates exist
|
#Check if certificates exist
|
||||||
#if [ bashio::fs.file_exists "/ssl/$CERTFILE" ] && [ bashio::fs.file_exists "/ssl/$KEYFILE" ]; then
|
#if [ bashio::fs.file_exists "/ssl/$CERTFILE" ] && [ bashio::fs.file_exists "/ssl/$KEYFILE" ]; then
|
||||||
cd /config/qBittorrent
|
cd /config/qBittorrent
|
||||||
LINE=$(sed -n '/Preferences/=' qBittorrent.conf)
|
|
||||||
LINE=$[LINE + 1]
|
|
||||||
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
|
||||||
@@ -22,4 +24,15 @@ if bashio::config.true 'ssl'; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
bashio::log.info "Default username/password : admin/adminadmin"
|
bashio::log.info "Default username/password : admin/adminadmin"
|
||||||
|
|
||||||
|
if bashio::config.has_value 'whitelist'; then
|
||||||
|
WHITELIST=$(bashio::config 'whitelist')
|
||||||
|
#clean data
|
||||||
|
sed -i '/AuthSubnetWhitelist/d' /config/qBittorrent/qBittorrent.conf
|
||||||
|
cd /config/qBittorrent
|
||||||
|
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"
|
||||||
|
fi
|
||||||
|
|
||||||
bashio::log.info "Configuration can be found in /config/qBittorrent"
|
bashio::log.info "Configuration can be found in /config/qBittorrent"
|
||||||
|
|||||||
Reference in New Issue
Block a user