Update 99-run.sh

This commit is contained in:
Alexandre
2023-11-25 22:46:20 +01:00
committed by GitHub
parent cd52b0d51c
commit 625116ef82

View File

@@ -2,6 +2,39 @@
# shellcheck shell=bash
set -e
####################
# Migrate database #
####################
if [ -f /homeassistant/addons_config/cloudcommander ]; then
echo "Moving database to new location /config"
cp -rnf /homeassistant/addons_config/cloudcommander/* /config/
rm -r /homeassistant/addons_config/cloudcommander
fi
######################
# Link addon folders #
######################
# Clean symlinks
find /config -maxdepth 1 -type l -delete
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
fi
# Create symlinks
ln -s /homeassistant/addons_config /config
ln -s /homeassistant/addons_autoscripts /config
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser*" -exec ln -s {} /config/addons_config/ \;
#################
# NGINX SETTING #
#################