mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
e5adbd266f
commit
f728166b14
@@ -1,27 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -d /share/storage/tv ]; then
|
||||
echo "Creating /share/storage/tv"
|
||||
mkdir -p /share/storage/tv
|
||||
chown -R "$PUID:$PGID" /share/storage/tv
|
||||
echo "Creating /share/storage/tv"
|
||||
mkdir -p /share/storage/tv
|
||||
chown -R "$PUID:$PGID" /share/storage/tv
|
||||
fi
|
||||
|
||||
if [ ! -d /share/downloads ]; then
|
||||
echo "Creating /share/downloads"
|
||||
mkdir -p /share/downloads
|
||||
chown -R "$PUID:$PGID" /share/downloads
|
||||
echo "Creating /share/downloads"
|
||||
mkdir -p /share/downloads
|
||||
chown -R "$PUID:$PGID" /share/downloads
|
||||
fi
|
||||
|
||||
if [ -d /config/sonarr ] && [ ! -d /config/addons_config/sonarr ]; then
|
||||
echo "Moving to new location /config/addons_config/sonarr"
|
||||
mkdir -p /config/addons_config/sonarr
|
||||
chown -R "$PUID:$PGID" /config/addons_config/sonarr
|
||||
mv /config/sonarr/* /config/addons_config/sonarr/
|
||||
rm -r /config/sonarr
|
||||
echo "Moving to new location /config/addons_config/sonarr"
|
||||
mkdir -p /config/addons_config/sonarr
|
||||
chown -R "$PUID:$PGID" /config/addons_config/sonarr
|
||||
mv /config/sonarr/* /config/addons_config/sonarr/
|
||||
rm -r /config/sonarr
|
||||
fi
|
||||
|
||||
if [ ! -d /config/addons_config/sonarr ]; then
|
||||
echo "Creating /config/addons_config/sonarr"
|
||||
mkdir -p /config/addons_config/sonarr
|
||||
chown -R "$PUID:$PGID" /config/addons_config/sonarr
|
||||
echo "Creating /config/addons_config/sonarr"
|
||||
mkdir -p /config/addons_config/sonarr
|
||||
chown -R "$PUID:$PGID" /config/addons_config/sonarr
|
||||
fi
|
||||
|
||||
@@ -25,41 +25,41 @@ CONFIG_LOCATION=/config/addons_config/"$slug"/config.xml
|
||||
|
||||
if [ -f "$CONFIG_LOCATION" ]; then
|
||||
|
||||
# Define addon mode
|
||||
connection_mode="$(bashio::config "connection_mode")"
|
||||
bashio::log.green "---------------------------"
|
||||
bashio::log.green "Connection_mode is $connection_mode"
|
||||
bashio::log.green "---------------------------"
|
||||
case "$connection_mode" in
|
||||
# Ingress mode, authentification is disabled
|
||||
ingress_noauth)
|
||||
bashio::log.green "Ingress is enabled, authentification is disabled"
|
||||
bashio::log.yellow "WARNING : Make sure that the port is not exposed externally by your router to avoid a security risk !"
|
||||
# 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"
|
||||
;;
|
||||
# Ingress mode, with authentification
|
||||
ingress_auth)
|
||||
bashio::log.green "Ingress is enabled, and external authentification is enabled"
|
||||
# Define UrlBase
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "2a <UrlBase>$slug<\/UrlBase>" "$CONFIG_LOCATION"
|
||||
sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
;;
|
||||
# No ingress mode, with authentification
|
||||
noingress_auth)
|
||||
bashio::log.green "Disabling ingress and enabling authentification"
|
||||
bashio::log.yellow "WARNING : Ingress is disabled so the app won't be available from HA itself !"
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
;;
|
||||
esac
|
||||
# Define addon mode
|
||||
connection_mode="$(bashio::config "connection_mode")"
|
||||
bashio::log.green "---------------------------"
|
||||
bashio::log.green "Connection_mode is $connection_mode"
|
||||
bashio::log.green "---------------------------"
|
||||
case "$connection_mode" in
|
||||
# Ingress mode, authentification is disabled
|
||||
ingress_noauth)
|
||||
bashio::log.green "Ingress is enabled, authentification is disabled"
|
||||
bashio::log.yellow "WARNING : Make sure that the port is not exposed externally by your router to avoid a security risk !"
|
||||
# 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"
|
||||
;;
|
||||
# Ingress mode, with authentification
|
||||
ingress_auth)
|
||||
bashio::log.green "Ingress is enabled, and external authentification is enabled"
|
||||
# Define UrlBase
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "2a <UrlBase>$slug<\/UrlBase>" "$CONFIG_LOCATION"
|
||||
sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
;;
|
||||
# No ingress mode, with authentification
|
||||
noingress_auth)
|
||||
bashio::log.green "Disabling ingress and enabling authentification"
|
||||
bashio::log.yellow "WARNING : Ingress is disabled so the app won't be available from HA itself !"
|
||||
sed -i "/UrlBase/d" "$CONFIG_LOCATION"
|
||||
sed -i "/<AuthenticationMethod>external/d" "$CONFIG_LOCATION"
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user