mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
Github bot : script beautyshied
This commit is contained in:
@@ -47,7 +47,7 @@ if bashio::config.has_value 'networkdisks'; then
|
||||
# Clean name of network share
|
||||
# shellcheck disable=SC2116,SC2001
|
||||
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
|
||||
disk="${disk//"\040"/ }" #replace \040 with
|
||||
disk="${disk//"\040"/ }" #replace \040 with
|
||||
diskname="${disk//\\//}" #replace \ with /
|
||||
diskname="${diskname##*/}" # Get only last part of the name
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ ln -s "$DATABASELOCATION"/influxdb /opt/scrutiny
|
||||
###############################
|
||||
|
||||
if [ -f /data/scrutiny.db ]; then
|
||||
bashio::log.warning "Previous database detected, migration will start. Backup stored in /share/scrutiny.db.bak"
|
||||
cp /data/scrutiny.db /share/scrutiny.db.bak
|
||||
mv /data/scrutiny.db "$DATABASELOCATION"/config/
|
||||
bashio::log.warning "Previous database detected, migration will start. Backup stored in /share/scrutiny.db.bak"
|
||||
cp /data/scrutiny.db /share/scrutiny.db.bak
|
||||
mv /data/scrutiny.db "$DATABASELOCATION"/config/
|
||||
fi
|
||||
|
||||
######
|
||||
@@ -30,9 +30,9 @@ fi
|
||||
|
||||
# Align timezone with options
|
||||
if bashio::config.has_value "TZ"; then
|
||||
TZ="$(bashio::config 'TZ')"
|
||||
bashio::log.info "Timezone : $TZ"
|
||||
sed -i "1a export TZ=$TZ" /etc/cont-init.d/10-timezone
|
||||
TZ="$(bashio::config 'TZ')"
|
||||
bashio::log.info "Timezone : $TZ"
|
||||
sed -i "1a export TZ=$TZ" /etc/cont-init.d/10-timezone
|
||||
fi
|
||||
|
||||
################
|
||||
|
||||
@@ -25,9 +25,9 @@ ln -s "$DATABASELOCATION"/influxdb /opt/scrutiny
|
||||
###############################
|
||||
|
||||
if [ -f /data/scrutiny.db ]; then
|
||||
bashio::log.warning "Previous database detected, migration will start. Backup stored in /share/scrutiny.db.bak"
|
||||
cp /data/scrutiny.db /share/scrutiny.db.bak
|
||||
mv /data/scrutiny.db "$DATABASELOCATION"/config/
|
||||
bashio::log.warning "Previous database detected, migration will start. Backup stored in /share/scrutiny.db.bak"
|
||||
cp /data/scrutiny.db /share/scrutiny.db.bak
|
||||
mv /data/scrutiny.db "$DATABASELOCATION"/config/
|
||||
fi
|
||||
|
||||
######
|
||||
@@ -36,9 +36,9 @@ fi
|
||||
|
||||
# Align timezone with options
|
||||
if bashio::config.has_value "TZ"; then
|
||||
TZ="$(bashio::config 'TZ')"
|
||||
bashio::log.info "Timezone : $TZ"
|
||||
sed -i "1a export TZ=$TZ" /etc/cont-init.d/10-timezone
|
||||
TZ="$(bashio::config 'TZ')"
|
||||
bashio::log.info "Timezone : $TZ"
|
||||
sed -i "1a export TZ=$TZ" /etc/cont-init.d/10-timezone
|
||||
fi
|
||||
|
||||
################
|
||||
|
||||
@@ -11,9 +11,9 @@ export SECRET_KEY=$(bashio::config 'SECRET_KEY') && bashio::log.blue "SECRET_KEY
|
||||
|
||||
CSRF_TRUSTED_ORIGINS="http://localhost"
|
||||
for element in ${ALLOWED_HOSTS//,/ }; do # Separate comma separated values
|
||||
element="${element#"https://"}"
|
||||
element="${element#"http://"}"
|
||||
CSRF_TRUSTED_ORIGINS="http://$element,https://$element,$CSRF_TRUSTED_ORIGINS"
|
||||
element="${element#"https://"}"
|
||||
element="${element#"http://"}"
|
||||
CSRF_TRUSTED_ORIGINS="http://$element,https://$element,$CSRF_TRUSTED_ORIGINS"
|
||||
done
|
||||
export CSRF_TRUSTED_ORIGINS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user