mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-15 06:09:08 +02:00
Compare commits
6 Commits
7e59aa8803
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed59a7140d | ||
|
|
a158621de9 | ||
|
|
c95c53eb63 | ||
|
|
d9b525b464 | ||
|
|
b48899b5bf | ||
|
|
830c6cebec |
@@ -7,11 +7,23 @@ set -e
|
||||
####################
|
||||
|
||||
if [ -f /homeassistant/addons_config/filebrowser_quantum/filebrowser_quantum.db ]; then
|
||||
echo "Moving database to new location /config"
|
||||
echo "Moving database from legacy addons_config location to /config"
|
||||
cp -rnf /homeassistant/addons_config/filebrowser_quantum/* /config/
|
||||
rm -r /homeassistant/addons_config/filebrowser_quantum
|
||||
fi
|
||||
|
||||
if [ ! -f /config/filebrowser_quantum.db ] && [ -d /addon_configs ]; then
|
||||
shopt -s nullglob
|
||||
for addon_config_dir in /addon_configs/*_filebrowser_quantum; do
|
||||
if [ -f "$addon_config_dir/filebrowser_quantum.db" ]; then
|
||||
echo "Moving database from addon_configs location to /config"
|
||||
cp -rnf "$addon_config_dir"/. /config/
|
||||
break
|
||||
fi
|
||||
done
|
||||
shopt -u nullglob
|
||||
fi
|
||||
|
||||
######################
|
||||
# Link addon folders #
|
||||
######################
|
||||
@@ -21,21 +33,30 @@ find /config -maxdepth 1 -type l -delete
|
||||
if [ -d /homeassistant/addons_config ]; then
|
||||
find /homeassistant/addons_config -maxdepth 1 -type l -delete
|
||||
fi
|
||||
|
||||
# Remove erroneous folders
|
||||
if [ -d /homeassistant ]; then
|
||||
if [ -d /config/addons_config ]; then
|
||||
rm -r /config/addons_config
|
||||
fi
|
||||
if [ -d /config/addon_configs ]; then
|
||||
rm -r /config/addon_configs
|
||||
fi
|
||||
if [ -d /config/addons_autoscripts ]; then
|
||||
rm -r /config/addons_autoscripts
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create symlinks with legacy folders
|
||||
addon_configs_symlink_dir=""
|
||||
if [ -d /homeassistant/addons_config ]; then
|
||||
ln -s /homeassistant/addons_config /config
|
||||
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} /config/addons_config/ \;
|
||||
addon_configs_symlink_dir="/config/addons_config"
|
||||
elif [ -d /addon_configs ]; then
|
||||
mkdir -p /config/addon_configs
|
||||
addon_configs_symlink_dir="/config/addon_configs"
|
||||
fi
|
||||
if [ -n "$addon_configs_symlink_dir" ] && [ -d /addon_configs ]; then
|
||||
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} "$addon_configs_symlink_dir"/ \;
|
||||
fi
|
||||
if [ -d /homeassistant/addons_autoscripts ]; then
|
||||
ln -s /homeassistant/addons_autoscripts /config
|
||||
|
||||
Reference in New Issue
Block a user