diff --git a/.templates/00-smb_mounts.sh b/.templates/00-smb_mounts.sh index 9ef456616..5bddb1b0b 100755 --- a/.templates/00-smb_mounts.sh +++ b/.templates/00-smb_mounts.sh @@ -9,50 +9,50 @@ set -e test_mount () { - # Set initial test - MOUNTED=false - ERROR_MOUNT=false + # Set initial test + MOUNTED=false + ERROR_MOUNT=false - # Exit if not mounted - if ! mountpoint -q /mnt/"$diskname"; then - return 0 - fi - - # Exit if can't write - # shellcheck disable=SC2015 - mkdir "/mnt/$diskname/testaze" && touch "/mnt/$diskname/testaze/testaze" && rm -r "/mnt/$diskname/testaze" || ERROR_MOUNT=true - if [[ "$ERROR_MOUNT" == "true" ]]; then - # Test write permissions - if [[ "$MOUNTOPTIONS" == *"noserverino"* ]]; then - bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" - else - MOUNTOPTIONS="$MOUNTOPTIONS,noserverino" - echo "... testing with noserverino" - mount_drive "$MOUNTOPTIONS" - fi + # Exit if not mounted + if ! mountpoint -q /mnt/"$diskname"; then return 0 - fi + fi - # Set correctly mounted bit - MOUNTED=true + # Exit if can't write + # shellcheck disable=SC2015 + mkdir "/mnt/$diskname/testaze" && touch "/mnt/$diskname/testaze/testaze" && rm -r "/mnt/$diskname/testaze" || ERROR_MOUNT=true + if [[ "$ERROR_MOUNT" == "true" ]]; then + # Test write permissions + if [[ "$MOUNTOPTIONS" == *"noserverino"* ]]; then + bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw" + else + MOUNTOPTIONS="$MOUNTOPTIONS,noserverino" + echo "... testing with noserverino" + mount_drive "$MOUNTOPTIONS" + fi return 0 + fi + + # Set correctly mounted bit + MOUNTED=true + return 0 } mount_drive () { - # Define options - MOUNTED=true - MOUNTOPTIONS="$1" + # Define options + MOUNTED=true + MOUNTOPTIONS="$1" - # Try mounting - mount -t cifs -o "$MOUNTOPTIONS" "$disk" /mnt/"$diskname" 2>ERRORCODE || MOUNTED=false + # Try mounting + mount -t cifs -o "$MOUNTOPTIONS" "$disk" /mnt/"$diskname" 2>ERRORCODE || MOUNTED=false - # Test if succesful - if [[ "$MOUNTED" == "true" ]]; then - # shellcheck disable=SC2015 - test_mount - fi + # Test if succesful + if [[ "$MOUNTED" == "true" ]]; then + # shellcheck disable=SC2015 + test_mount + fi } @@ -137,7 +137,7 @@ if bashio::config.has_value 'networkdisks'; then # Quickly try to mount with defaults mount_drive "rw,file_mode=0775,dir_mode=0775,username=${USERNAME},password=${PASSWORD},nobrl${SMBVERS}${SECVERS}${PUID}${PGID}${CHARSET}${DOMAIN}" - + # Deeper analysis if failed if [ "$MOUNTED" = false ]; then @@ -189,18 +189,18 @@ if bashio::config.has_value 'networkdisks'; then # Manage output if [ -n "$SMBVERS" ]; then case $SMBVERS in - 202) - SMBVERS="2.0" - ;; - 21) - SMBVERS="2.1" - ;; - 302) - SMBVERS="3.02" - ;; - 311) - SMBVERS="3.1.1" - ;; + 202) + SMBVERS="2.0" + ;; + 21) + SMBVERS="2.1" + ;; + 302) + SMBVERS="3.02" + ;; + 311) + SMBVERS="3.1.1" + ;; esac echo "...... SMB version detected : $SMBVERS" SMBVERS=",vers=$SMBVERS" @@ -217,7 +217,7 @@ if bashio::config.has_value 'networkdisks'; then ####################################### for SECVERS in "$SECVERS" ",sec=ntlmv2" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=krb5i" ",sec=krb5" ",sec=ntlm" ",sec=ntlmv2i"; do if [ "$MOUNTED" = false ]; then - mount_drive "rw,file_mode=0775,dir_mode=0775,username=${USERNAME},password=${PASSWORD},nobrl${SMBVERS}${SECVERS}${PUID}${PGID}${CHARSET}${DOMAIN}" + mount_drive "rw,file_mode=0775,dir_mode=0775,username=${USERNAME},password=${PASSWORD},nobrl${SMBVERS}${SECVERS}${PUID}${PGID}${CHARSET}${DOMAIN}" fi done diff --git a/.templates/01-config_yaml.sh b/.templates/01-config_yaml.sh index a153b2bd4..d7b75f167 100755 --- a/.templates/01-config_yaml.sh +++ b/.templates/01-config_yaml.sh @@ -83,9 +83,9 @@ fi echo "" bashio::log.green "Load environment variables from $CONFIGSOURCE if existing" if [[ "$CONFIGSOURCE" == "/config"* ]]; then - bashio::log.green "If accessing the file with filebrowser it should be mapped to $CONFIGFILEBROWSER" + bashio::log.green "If accessing the file with filebrowser it should be mapped to $CONFIGFILEBROWSER" else - bashio::log.green "If accessing the file with filebrowser it should be mapped to $CONFIGSOURCE" + bashio::log.green "If accessing the file with filebrowser it should be mapped to $CONFIGSOURCE" fi bashio::log.green "---------------------------------------------------------" bashio::log.green "Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables" diff --git a/cloudcommander/rootfs/etc/cont-init.d/99-run.sh b/cloudcommander/rootfs/etc/cont-init.d/99-run.sh index 8c04bf56e..d6764fcae 100755 --- a/cloudcommander/rootfs/etc/cont-init.d/99-run.sh +++ b/cloudcommander/rootfs/etc/cont-init.d/99-run.sh @@ -22,12 +22,12 @@ find /homeassistant/addons_config -maxdepth 1 -type l -delete # Remove erroneous folders if [ -d /homeassistant ]; then - if [ -d /config/addons_config ]; then - rm -r /config/addons_config - fi - if [ -d /config/addons_autoscripts ]; then - rm -r /config/addons_autoscripts - fi + if [ -d /config/addons_config ]; then + rm -r /config/addons_config + fi + if [ -d /config/addons_autoscripts ]; then + rm -r /config/addons_autoscripts + fi fi # Create symlinks diff --git a/filebrowser/rootfs/etc/cont-init.d/20-folders.sh b/filebrowser/rootfs/etc/cont-init.d/20-folders.sh index 590de695c..a5e2b11da 100755 --- a/filebrowser/rootfs/etc/cont-init.d/20-folders.sh +++ b/filebrowser/rootfs/etc/cont-init.d/20-folders.sh @@ -22,12 +22,12 @@ find /homeassistant/addons_config -maxdepth 1 -type l -delete # Remove erroneous folders if [ -d /homeassistant ]; then - if [ -d /config/addons_config ]; then - rm -r /config/addons_config - fi - if [ -d /config/addons_autoscripts ]; then - rm -r /config/addons_autoscripts - fi + if [ -d /config/addons_config ]; then + rm -r /config/addons_config + fi + if [ -d /config/addons_autoscripts ]; then + rm -r /config/addons_autoscripts + fi fi # Create symlinks diff --git a/immich/rootfs/etc/cont-init.d/20-folders.sh b/immich/rootfs/etc/cont-init.d/20-folders.sh index 6773d8f69..fbafa31c1 100755 --- a/immich/rootfs/etc/cont-init.d/20-folders.sh +++ b/immich/rootfs/etc/cont-init.d/20-folders.sh @@ -31,7 +31,7 @@ ln -sf "$DATA_LOCATION" /photos chown -R "$PUID":"$PGID" /photos mkdir -p "$MACHINE_LEARNING_CACHE_FOLDER" -mkdir -p "$TYPESENSE_DATA_DIR" +mkdir -p "$TYPESENSE_DATA_DIR" mkdir -p "$REVERSE_GEOCODING_DUMP_DIRECTORY" chown -R "$PUID":"$PGID" "$MACHINE_LEARNING_CACHE_FOLDER" chown -R "$PUID":"$PGID" "$TYPESENSE_DATA_DIR" diff --git a/omada/rootfs/etc/cont-init.d/99-run.sh b/omada/rootfs/etc/cont-init.d/99-run.sh index 1a6cb099e..f39a14800 100755 --- a/omada/rootfs/etc/cont-init.d/99-run.sh +++ b/omada/rootfs/etc/cont-init.d/99-run.sh @@ -39,7 +39,7 @@ for item in "$CONFIGSOURCE"/*; do # Get the base name of the file or folder base_name=$(basename "$item") # Create a symbolic link in the current working directory - ln -s "$item" /opt/tplink/EAPController/data/"$base_name" + ln -s "$item" /opt/tplink/EAPController/data/"$base_name" echo "Created symlink for '$base_name'" done diff --git a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh index 8f1825464..9a2ea9d85 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh @@ -225,8 +225,8 @@ if bashio::config.has_value 'customUI' && [ ! "$CUSTOMUI" = default ] && [ ! "$C sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUIDIR" "$CONFIG_LOCATION"/qBittorrent.conf # Set ingress ui if [[ "$CUSTOMUI" != qbit-matUI ]]; then - sed -i "s=/vuetorrent/public/=$CUSTOMUIDIR/public/=g" /etc/nginx/servers/ingress.conf || true - sed -i "s=vue.torrent=$CUSTOMUI.torrent=g" /etc/nginx/servers/ingress.conf || true + sed -i "s=/vuetorrent/public/=$CUSTOMUIDIR/public/=g" /etc/nginx/servers/ingress.conf || true + sed -i "s=vue.torrent=$CUSTOMUI.torrent=g" /etc/nginx/servers/ingress.conf || true fi fi diff --git a/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh b/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh index 54525d444..ab07585a2 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/92-qbit_manage.sh @@ -4,28 +4,28 @@ set -e if bashio::config.true "qbit_manage"; then - bashio::log.info "qbit_manage activated, setting system" + bashio::log.info "qbit_manage activated, setting system" - # Set folder - echo "... setting folder" - mkdir -p /config/qbit_manage - chmod -R 777 /config/qbit_manage + # Set folder + echo "... setting folder" + mkdir -p /config/qbit_manage + chmod -R 777 /config/qbit_manage - # Create default file - if [ ! -f /config/qbit_manage/qbit_manage.yml ]; then - echo "... create default file" - cp /qbit_manage/config/config.yml.sample /config/qbit_manage/qbit_manage.yml - fi + # Create default file + if [ ! -f /config/qbit_manage/qbit_manage.yml ]; then + echo "... create default file" + cp /qbit_manage/config/config.yml.sample /config/qbit_manage/qbit_manage.yml + fi - # Set qBittorrent options - echo "... align QBT username and password" - sed -i "/host:/c\ host: \"localhost:8080\"" /config/qbit_manage/qbit_manage.yml - sed -i "/user:/c\ user: \"$(bashio::config "QBT_USERNAME")\"" /config/qbit_manage/qbit_manage.yml - sed -i "s=root_dir: \"/data/torrents/\"=$(bashio::config.has_value "SavePath")=g" /config/qbit_manage/qbit_manage.yml - sed -i "s=remote_dir: \"/mnt/user/data/torrents/\"=$(bashio::config.has_value "SavePath")=g" /config/qbit_manage/qbit_manage.yml + # Set qBittorrent options + echo "... align QBT username and password" + sed -i "/host:/c\ host: \"localhost:8080\"" /config/qbit_manage/qbit_manage.yml + sed -i "/user:/c\ user: \"$(bashio::config "QBT_USERNAME")\"" /config/qbit_manage/qbit_manage.yml + sed -i "s=root_dir: \"/data/torrents/\"=$(bashio::config.has_value "SavePath")=g" /config/qbit_manage/qbit_manage.yml + sed -i "s=remote_dir: \"/mnt/user/data/torrents/\"=$(bashio::config.has_value "SavePath")=g" /config/qbit_manage/qbit_manage.yml - # Startup delay 30s ; config file specific ; log file specific - python /qbit_manage/qbit_manage.py -sd 30 --config-file "/config/qbit_manage/qbit_manage.yml" --log-file "/config/qbit_manage/qbit_manage.log" --run & true - bashio::log.info "qbit_manage started with config in /addon_configs/$HOSTNAME/qbit_manage/qbit_manage.yaml accessible with the Filebrowser addon" + # Startup delay 30s ; config file specific ; log file specific + python /qbit_manage/qbit_manage.py -sd 30 --config-file "/config/qbit_manage/qbit_manage.yml" --log-file "/config/qbit_manage/qbit_manage.log" --run & true + bashio::log.info "qbit_manage started with config in /addon_configs/$HOSTNAME/qbit_manage/qbit_manage.yaml accessible with the Filebrowser addon" fi diff --git a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh index 795953594..65e06f5d5 100755 --- a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh @@ -25,41 +25,41 @@ if bashio::config.true 'openvpn_enabled'; then # Function to check for files path function check_path () { -# Get variable -file="$1" + # Get variable + file="$1" -# Loop through each line of the input file -while read line -do - # Check if the line contains a txt file - if [[ "$line" =~ \.txt ]] || [[ "$line" =~ \.crt ]]; then - # Extract the txt file name from the line - file_name="$(echo "$line" | awk -F' ' '{print $2}')" - # Check if the txt file exists - if [ ! -f "$file_name" ]; then - # Check if the txt file exists in the /config/openvpn/ directory - if [ -f "/config/openvpn/${file_name##*/}" ]; then - # Append /config/openvpn/ in front of the original txt file in the ovpn file - sed -i "s/$file_name/\/config\/openvpn\/${file_name##*/}/g" "$file" - # Print a success message - bashio::log.warning "Appended /config/openvpn/ to ${file_name##*/} in $file" - else - # Print an error message - bashio::log.warning "$file_name is referenced in your ovpn file but does not exist, and can't be found either in the /config/openvpn/ directory" - fi - fi - fi -done < "$file" + # Loop through each line of the input file + while read line + do + # Check if the line contains a txt file + if [[ "$line" =~ \.txt ]] || [[ "$line" =~ \.crt ]]; then + # Extract the txt file name from the line + file_name="$(echo "$line" | awk -F' ' '{print $2}')" + # Check if the txt file exists + if [ ! -f "$file_name" ]; then + # Check if the txt file exists in the /config/openvpn/ directory + if [ -f "/config/openvpn/${file_name##*/}" ]; then + # Append /config/openvpn/ in front of the original txt file in the ovpn file + sed -i "s/$file_name/\/config\/openvpn\/${file_name##*/}/g" "$file" + # Print a success message + bashio::log.warning "Appended /config/openvpn/ to ${file_name##*/} in $file" + else + # Print an error message + bashio::log.warning "$file_name is referenced in your ovpn file but does not exist, and can't be found either in the /config/openvpn/ directory" + fi + fi + fi + done < "$file" -# Standardize lf -dos2unix "$file" + # Standardize lf + dos2unix "$file" - # Correct paths - sed -i "s=/etc/openvpn=/config/openvpn=g" "$file" + # Correct paths + sed -i "s=/etc/openvpn=/config/openvpn=g" "$file" } - + ##################### # CONFIGURE OPENVPN # ##################### @@ -76,30 +76,30 @@ dos2unix "$file" check_path /config/openvpn/"$openvpn_config" # Copy potential additional files cp /config/openvpn/* /etc/openvpn/ - # Standardize file   + # Standardize file cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn - # Not correct type + # Not correct type else bashio::exit.nok "Configured ovpn file : $openvpn_config is set but does not end by .ovpn ; it can't be used!" fi fi - # If openvpn_config not set, but folder is not empty + # If openvpn_config not set, but folder is not empty else - # Look for openvpn files - # Wildcard search for openvpn config files and store results in array - mapfile -t VPN_CONFIGS < <( find /config/openvpn -maxdepth 1 -name "*.ovpn" -print ) - # Choose random config - VPN_CONFIG="${VPN_CONFIGS[$RANDOM % ${#VPN_CONFIGS[@]}]}" - # Get the VPN_CONFIG name without the path and extension - openvpn_config="${VPN_CONFIG##*/}" - echo "... Openvpn enabled, but openvpn_config option empty. Selecting a random ovpn file : ${openvpn_config}" - # Check path - check_path /config/openvpn/"${openvpn_config}" - # Copy potential additional files - cp /config/openvpn/* /etc/openvpn/ - # Standardize file - cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn + # Look for openvpn files + # Wildcard search for openvpn config files and store results in array + mapfile -t VPN_CONFIGS < <( find /config/openvpn -maxdepth 1 -name "*.ovpn" -print ) + # Choose random config + VPN_CONFIG="${VPN_CONFIGS[$RANDOM % ${#VPN_CONFIGS[@]}]}" + # Get the VPN_CONFIG name without the path and extension + openvpn_config="${VPN_CONFIG##*/}" + echo "... Openvpn enabled, but openvpn_config option empty. Selecting a random ovpn file : ${openvpn_config}" + # Check path + check_path /config/openvpn/"${openvpn_config}" + # Copy potential additional files + cp /config/openvpn/* /etc/openvpn/ + # Standardize file + cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn fi # Set credentials diff --git a/radarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh b/radarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh index 1ed1a6ed6..fa2665278 100755 --- a/radarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh +++ b/radarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh @@ -24,25 +24,25 @@ slug=radarr 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 $slug<\/UrlBase>" "$CONFIG_LOCATION" - # Disable local auth - sed -i "/AuthenticationType/d" "$CONFIG_LOCATION" - sed -i "2a DisabledForLocalAddresses" "$CONFIG_LOCATION" - # Disable local auth - sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION" - sed -i "2a external" "$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 "/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 $slug<\/UrlBase>" "$CONFIG_LOCATION" + # Disable local auth + sed -i "/AuthenticationType/d" "$CONFIG_LOCATION" + sed -i "2a DisabledForLocalAddresses" "$CONFIG_LOCATION" + # Disable local auth + sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION" + sed -i "2a external" "$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 "/external/d" "$CONFIG_LOCATION" + fi fi diff --git a/readarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh b/readarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh index 4ab3e0d97..90887928a 100755 --- a/readarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh +++ b/readarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh @@ -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 $slug<\/UrlBase>" "$CONFIG_LOCATION" - # Disable local auth - sed -i "/AuthenticationType/d" "$CONFIG_LOCATION" - sed -i "2a DisabledForLocalAddresses" "$CONFIG_LOCATION" - # Disable local auth - # sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION" - # sed -i "2a external" "$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 "/external/d" "$CONFIG_LOCATION" - # sed -i "/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 $slug<\/UrlBase>" "$CONFIG_LOCATION" + # Disable local auth + sed -i "/AuthenticationType/d" "$CONFIG_LOCATION" + sed -i "2a DisabledForLocalAddresses" "$CONFIG_LOCATION" + # Disable local auth + # sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION" + # sed -i "2a external" "$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 "/external/d" "$CONFIG_LOCATION" + # sed -i "/external/d" "$CONFIG_LOCATION" + fi fi diff --git a/signalk/rootfs/etc/cont-init.d/99-run.sh b/signalk/rootfs/etc/cont-init.d/99-run.sh index 6675c2a41..c6d1d8441 100755 --- a/signalk/rootfs/etc/cont-init.d/99-run.sh +++ b/signalk/rootfs/etc/cont-init.d/99-run.sh @@ -5,7 +5,7 @@ set -e # Set configuration directory if [ -d /home/node/.signalk ]; then - rm -r /home/node/.signalk + rm -r /home/node/.signalk fi ln -sf /config /home/node/.signalk chown -R node:node /config diff --git a/sonarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh b/sonarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh index 057fa6990..b9ed14e86 100755 --- a/sonarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh +++ b/sonarr/rootfs/etc/cont-init.d/32-nginx_ingress.sh @@ -24,25 +24,25 @@ slug=sonarr 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 $slug<\/UrlBase>" "$CONFIG_LOCATION" - # Disable local auth - sed -i "/AuthenticationType/d" "$CONFIG_LOCATION" - sed -i "2a DisabledForLocalAddresses" "$CONFIG_LOCATION" - # Disable local auth - sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION" - sed -i "2a external" "$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 "/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 $slug<\/UrlBase>" "$CONFIG_LOCATION" + # Disable local auth + sed -i "/AuthenticationType/d" "$CONFIG_LOCATION" + sed -i "2a DisabledForLocalAddresses" "$CONFIG_LOCATION" + # Disable local auth + sed -i "/AuthenticationMethod/d" "$CONFIG_LOCATION" + sed -i "2a external" "$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 "/external/d" "$CONFIG_LOCATION" + fi fi