mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-18 10:28:17 +01:00
Update 20-config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user