Update 20-config

This commit is contained in:
Alexandre
2021-10-30 22:52:58 +02:00
committed by GitHub
parent 3c792bff9a
commit 4c7af59b75

View File

@@ -73,3 +73,31 @@ if bashio::config.has_value 'customUI'; then
export TRANSMISSION_WEB_HOME=/$CUSTOMUI/
bashio::log.info "UI selected : $TRANSMISSION_WEB_HOME"
fi
# From linuxserver
if [ ! -z "$USER" ] && [ ! -z "$PASS" ]; then
sed -i '/rpc-authentication-required/c\ "rpc-authentication-required": true,' /config/settings.json
sed -i "/rpc-username/c\ \"rpc-username\": \"$USER\"," /config/settings.json
sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json
else
sed -i '/rpc-authentication-required/c\ "rpc-authentication-required": false,' /config/settings.json
sed -i "/rpc-username/c\ \"rpc-username\": \"$USER\"," /config/settings.json
sed -i "/rpc-password/c\ \"rpc-password\": \"$PASS\"," /config/settings.json
fi
if [ ! -z "$WHITELIST" ]; then
sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": true,' /config/settings.json
sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json
else
sed -i '/rpc-whitelist-enabled/c\ "rpc-whitelist-enabled": false,' /config/settings.json
sed -i "/\"rpc-whitelist\"/c\ \"rpc-whitelist\": \"$WHITELIST\"," /config/settings.json
fi
if [ ! -z "$HOST_WHITELIST" ]; then
sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": true,' /config/settings.json
sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$HOST_WHITELIST\"," /config/settings.json
else
sed -i '/rpc-host-whitelist-enabled/c\ "rpc-host-whitelist-enabled": false,' /config/settings.json
sed -i "/\"rpc-host-whitelist\"/c\ \"rpc-host-whitelist\": \"$HOST_WHITELIST\"," /config/settings.json
fi