mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
Github bot : script beautyshied
This commit is contained in:
@@ -24,26 +24,26 @@ slug=readarr
|
||||
CONFIG_LOCATION=/config/addons_config/"$slug"/config.xml
|
||||
|
||||
if [ -f "$CONFIG_LOCATION" ]; then
|
||||
# Set UrlBase
|
||||
if ! bashio::config.true "ingress_disabled"; then
|
||||
bashio::log.warning "---------------------------"
|
||||
bashio::log.warning "Ingress is enabled, authentification will be disabled and should be managed through HA itself. If you need authentification, please disable ingress in addon options"
|
||||
bashio::log.warning "---------------------------"
|
||||
# Define UrlBase
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "2a <UrlBase>$slug<\/UrlBase>" "$CONFIG_LOCATION"
|
||||
# Disable local auth
|
||||
sed -i "/AuthenticationType/d" "$CONFIG_LOCATION"
|
||||
sed -i "2a <AuthenticationType>DisabledForLocalAddresses</AuthenticationType>" "$CONFIG_LOCATION"
|
||||
# Disable local auth
|
||||
# sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION"
|
||||
# sed -i "2a <AuthenticationMethod>external</AuthenticationMethod>" "$CONFIG_LOCATION"
|
||||
else
|
||||
bashio::log.warning "---------------------------"
|
||||
bashio::log.info "Disabling ingress and enabling authentification"
|
||||
bashio::log.warning "---------------------------"
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
# sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
fi
|
||||
# Set UrlBase
|
||||
if ! bashio::config.true "ingress_disabled"; then
|
||||
bashio::log.warning "---------------------------"
|
||||
bashio::log.warning "Ingress is enabled, authentification will be disabled and should be managed through HA itself. If you need authentification, please disable ingress in addon options"
|
||||
bashio::log.warning "---------------------------"
|
||||
# Define UrlBase
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "2a <UrlBase>$slug<\/UrlBase>" "$CONFIG_LOCATION"
|
||||
# Disable local auth
|
||||
sed -i "/AuthenticationType/d" "$CONFIG_LOCATION"
|
||||
sed -i "2a <AuthenticationType>DisabledForLocalAddresses</AuthenticationType>" "$CONFIG_LOCATION"
|
||||
# Disable local auth
|
||||
# sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION"
|
||||
# sed -i "2a <AuthenticationMethod>external</AuthenticationMethod>" "$CONFIG_LOCATION"
|
||||
else
|
||||
bashio::log.warning "---------------------------"
|
||||
bashio::log.info "Disabling ingress and enabling authentification"
|
||||
bashio::log.warning "---------------------------"
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
# sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user