mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-09 17:31:03 +01:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
e5adbd266f
commit
f728166b14
@@ -7,10 +7,9 @@ set -e
|
||||
####################
|
||||
|
||||
if [ -d /homeassistant/addons_config/calibre-web ] && [ ! -L /homeassistant/addons_config/calibre-web ]; then
|
||||
if [ "$(ls -A /homeassistant/addons_config/calibre-web)" ]; then
|
||||
echo "Moving database to new location /config"
|
||||
cp -rf /homeassistant/addons_config/calibre-web/* "$LOCATION"/
|
||||
fi
|
||||
rm -r /homeassistant/addons_config/calibre-web
|
||||
if [ "$(ls -A /homeassistant/addons_config/calibre-web)" ]; then
|
||||
echo "Moving database to new location /config"
|
||||
cp -rf /homeassistant/addons_config/calibre-web/* "$LOCATION"/
|
||||
fi
|
||||
rm -r /homeassistant/addons_config/calibre-web
|
||||
fi
|
||||
|
||||
|
||||
@@ -10,23 +10,23 @@ PGID=$(bashio::config "PGID")
|
||||
LOCATION=$(bashio::config 'data_location')
|
||||
|
||||
if [[ "$LOCATION" = "null" || -z "$LOCATION" ]]; then
|
||||
# Default location
|
||||
LOCATION="/config"
|
||||
# Default location
|
||||
LOCATION="/config"
|
||||
else
|
||||
bashio::log.warning "Warning : a custom data location was selected, but the previous folder will NOT be copied. You need to do it manually"
|
||||
bashio::log.warning "Warning : a custom data location was selected, but the previous folder will NOT be copied. You need to do it manually"
|
||||
|
||||
# Check if config is located in an acceptable location
|
||||
LOCATIONOK=""
|
||||
for location in "/share" "/config" "/data" "/mnt"; do
|
||||
if [[ "$LOCATION" == "$location"* ]]; then
|
||||
LOCATIONOK=true
|
||||
fi
|
||||
done
|
||||
# Check if config is located in an acceptable location
|
||||
LOCATIONOK=""
|
||||
for location in "/share" "/config" "/data" "/mnt"; do
|
||||
if [[ "$LOCATION" == "$location"* ]]; then
|
||||
LOCATIONOK=true
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$LOCATIONOK" ]; then
|
||||
LOCATION=/config
|
||||
bashio::log.fatal "Your data_location value can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $LOCATION"
|
||||
fi
|
||||
if [ -z "$LOCATIONOK" ]; then
|
||||
LOCATION=/config
|
||||
bashio::log.fatal "Your data_location value can only be set in /share, /config or /data (internal to addon). It will be reset to the default location : $LOCATION"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
@@ -37,10 +37,10 @@ sed -i "1a export FM_HOME=$LOCATION" /etc/services.d/*/run
|
||||
sed -i "s|/config|$LOCATION|g" /defaults/*
|
||||
sed -i "s|/config|$LOCATION|g" /etc/cont-init.d/*
|
||||
sed -i "s|/config|$LOCATION|g" /etc/services.d/*/run
|
||||
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/HOME; fi
|
||||
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" > /var/run/s6/container_environment/FM_HOME; fi
|
||||
printf "%s\n" "HOME=\"$LOCATION\"" >> ~/.bashrc
|
||||
printf "%s\n" "FM_HOME=\"$LOCATION\"" >> ~/.bashrc
|
||||
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" >/var/run/s6/container_environment/HOME; fi
|
||||
if [ -d /var/run/s6/container_environment ]; then printf "%s" "$LOCATION" >/var/run/s6/container_environment/FM_HOME; fi
|
||||
printf "%s\n" "HOME=\"$LOCATION\"" >>~/.bashrc
|
||||
printf "%s\n" "FM_HOME=\"$LOCATION\"" >>~/.bashrc
|
||||
|
||||
usermod --home "$LOCATION" abc
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -d /config ]; then
|
||||
echo "Creating /config"
|
||||
mkdir -p /config
|
||||
echo "Creating /config"
|
||||
mkdir -p /config
|
||||
fi
|
||||
|
||||
chown -R "$PUID:$PGID" /config
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f /etc/cont-init.d/00-smb_mounts.sh ]; then
|
||||
sed -i "s|cifs -o \"|cifs -o \"nobrl,|g" /etc/cont-init.d/00-smb_mounts.sh
|
||||
sed -i "s|cifs -o \"|cifs -o \"nobrl,|g" /etc/cont-init.d/00-smb_mounts.sh
|
||||
fi
|
||||
|
||||
@@ -42,7 +42,7 @@ declare ingress_port
|
||||
|
||||
ingress_user='admin'
|
||||
if bashio::config.has_value 'ingress_user'; then
|
||||
ingress_user=$(bashio::config 'ingress_user')
|
||||
ingress_user=$(bashio::config 'ingress_user')
|
||||
fi
|
||||
|
||||
ingress_port=$(bashio::addon.ingress_port)
|
||||
|
||||
@@ -5,9 +5,9 @@ set -e
|
||||
|
||||
# Set TZ
|
||||
if bashio::config.has_value 'TZ'; then
|
||||
TIMEZONE=$(bashio::config 'TZ')
|
||||
bashio::log.info "Setting timezone to $TIMEZONE"
|
||||
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime && echo "$TIMEZONE" >/etc/timezone
|
||||
TIMEZONE=$(bashio::config 'TZ')
|
||||
bashio::log.info "Setting timezone to $TIMEZONE"
|
||||
ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime && echo "$TIMEZONE" >/etc/timezone
|
||||
fi
|
||||
|
||||
bashio::log.info "Install libnss3"
|
||||
@@ -15,9 +15,9 @@ apt-get update && apt-get install libnss3 &>/dev/null
|
||||
|
||||
# Set Ingress login
|
||||
if [ ! -f /config/app.db ]; then
|
||||
bashio::log.warning "First boot : disabling Ingress until addon restart"
|
||||
bashio::log.warning "First boot : disabling Ingress until addon restart"
|
||||
else
|
||||
sqlite3 /config/app.db 'update settings set config_reverse_proxy_login_header_name="X-WebAuth-User",config_allow_reverse_proxy_header_login=1'
|
||||
sqlite3 /config/app.db 'update settings set config_reverse_proxy_login_header_name="X-WebAuth-User",config_allow_reverse_proxy_header_login=1'
|
||||
fi
|
||||
|
||||
bashio::log.info "Default username:password is admin:admin123"
|
||||
|
||||
Reference in New Issue
Block a user