Github bot : script beautyshied

This commit is contained in:
github-actions
2023-12-24 03:38:08 +00:00
parent d47aa81b1b
commit 237173f370
13 changed files with 195 additions and 195 deletions

View File

@@ -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