mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Github bot : script beautyshied
This commit is contained in:
@@ -8,7 +8,7 @@ mkdir -p /config/addons_autoscripts
|
|||||||
|
|
||||||
# Migrate scripts
|
# Migrate scripts
|
||||||
if [ -f /config/"${slug}".sh ]; then
|
if [ -f /config/"${slug}".sh ]; then
|
||||||
mv -f /config/"${slug}".sh /config/addons_autoscripts/"${slug}".sh
|
mv -f /config/"${slug}".sh /config/addons_autoscripts/"${slug}".sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Execute scripts
|
# Execute scripts
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ bashio::log.info "Defining database"
|
|||||||
|
|
||||||
case $(bashio::config 'database') in
|
case $(bashio::config 'database') in
|
||||||
|
|
||||||
# Use mariadb
|
# Use mariadb
|
||||||
mariadb_addon)
|
mariadb_addon)
|
||||||
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
|
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..."
|
||||||
if ! bashio::services.available 'mysql'; then
|
if ! bashio::services.available 'mysql'; then
|
||||||
@@ -58,7 +58,7 @@ case $(bashio::config 'database') in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
# Use sqlite
|
# Use sqlite
|
||||||
*)
|
*)
|
||||||
bashio::log.info "Using sqlite as database driver"
|
bashio::log.info "Using sqlite as database driver"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ change_folders () {
|
|||||||
|
|
||||||
# Modify files
|
# Modify files
|
||||||
echo "Adapting files"
|
echo "Adapting files"
|
||||||
# shellcheck disable=SC2013,SC2086
|
# shellcheck disable=SC2013,SC2086
|
||||||
for file in $(grep -ril "$ORIGINALLOCATION" /etc /defaults); do sed -i "s=$ORIGINALLOCATION=$CONFIGLOCATION=g" $file; done
|
for file in $(grep -ril "$ORIGINALLOCATION" /etc /defaults); do sed -i "s=$ORIGINALLOCATION=$CONFIGLOCATION=g" $file; done
|
||||||
|
|
||||||
# Adapt sync.conf
|
# Adapt sync.conf
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ if bashio::config.true "expose_collector"; then
|
|||||||
bashio::log.info "collector.yaml exposed in /share/scrutiny"
|
bashio::log.info "collector.yaml exposed in /share/scrutiny"
|
||||||
mkdir -p /share/scrutiny
|
mkdir -p /share/scrutiny
|
||||||
if [ -f /data/config/collector.yaml ] ; then
|
if [ -f /data/config/collector.yaml ] ; then
|
||||||
cp -rnf /data/config/collector.yaml /share/scrutiny || true
|
cp -rnf /data/config/collector.yaml /share/scrutiny || true
|
||||||
rm -R /data/config/collector.yaml
|
rm -R /data/config/collector.yaml
|
||||||
fi
|
fi
|
||||||
if [ -f /opt/scrutiny/config/collector.yaml ] ; then
|
if [ -f /opt/scrutiny/config/collector.yaml ] ; then
|
||||||
cp -rnf /opt/scrutiny/config/collector.yaml /share/scrutiny || true
|
cp -rnf /opt/scrutiny/config/collector.yaml /share/scrutiny || true
|
||||||
rm /opt/scrutiny/config/collector.yaml
|
rm /opt/scrutiny/config/collector.yaml
|
||||||
fi
|
fi
|
||||||
touch /share/scrutiny/collector.yaml
|
touch /share/scrutiny/collector.yaml
|
||||||
ln -sf /share/scrutiny/collector.yaml /data/config || true
|
ln -sf /share/scrutiny/collector.yaml /data/config || true
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ if bashio::config.true "expose_collector"; then
|
|||||||
bashio::log.info "collector.yaml exposed in /share/scrutiny"
|
bashio::log.info "collector.yaml exposed in /share/scrutiny"
|
||||||
mkdir -p /share/scrutiny
|
mkdir -p /share/scrutiny
|
||||||
if [ -f /data/config/collector.yaml ] ; then
|
if [ -f /data/config/collector.yaml ] ; then
|
||||||
cp -rnf /data/config/collector.yaml /share/scrutiny || true
|
cp -rnf /data/config/collector.yaml /share/scrutiny || true
|
||||||
rm -R /data/config/collector.yaml
|
rm -R /data/config/collector.yaml
|
||||||
fi
|
fi
|
||||||
if [ -f /opt/scrutiny/config/collector.yaml ] ; then
|
if [ -f /opt/scrutiny/config/collector.yaml ] ; then
|
||||||
cp -rnf /opt/scrutiny/config/collector.yaml /share/scrutiny || true
|
cp -rnf /opt/scrutiny/config/collector.yaml /share/scrutiny || true
|
||||||
rm /opt/scrutiny/config/collector.yaml
|
rm /opt/scrutiny/config/collector.yaml
|
||||||
fi
|
fi
|
||||||
touch /share/scrutiny/collector.yaml
|
touch /share/scrutiny/collector.yaml
|
||||||
ln -sf /share/scrutiny/collector.yaml /data/config || true
|
ln -sf /share/scrutiny/collector.yaml /data/config || true
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ if bashio::config.true 'ssl'; then
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
export HTTPS=false
|
export HTTPS=false
|
||||||
export SSL=false
|
export SSL=false
|
||||||
export HTTPS_REDIRECT=false
|
export HTTPS_REDIRECT=false
|
||||||
BASE_URL=$(bashio::config 'BASE_URL'):$(bashio::addon.port 80)
|
BASE_URL=$(bashio::config 'BASE_URL'):$(bashio::addon.port 80)
|
||||||
export BASE_URL="${BASE_URL/https:/http:}"
|
export BASE_URL="${BASE_URL/https:/http:}"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user