mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-19 16:23:59 +02:00
Compare commits
6 Commits
9643ca35a3
...
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
|
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/
|
cp -rnf /homeassistant/addons_config/filebrowser_quantum/* /config/
|
||||||
rm -r /homeassistant/addons_config/filebrowser_quantum
|
rm -r /homeassistant/addons_config/filebrowser_quantum
|
||||||
fi
|
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 #
|
# Link addon folders #
|
||||||
######################
|
######################
|
||||||
@@ -21,21 +33,30 @@ find /config -maxdepth 1 -type l -delete
|
|||||||
if [ -d /homeassistant/addons_config ]; then
|
if [ -d /homeassistant/addons_config ]; then
|
||||||
find /homeassistant/addons_config -maxdepth 1 -type l -delete
|
find /homeassistant/addons_config -maxdepth 1 -type l -delete
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove erroneous folders
|
# Remove erroneous folders
|
||||||
if [ -d /homeassistant ]; then
|
if [ -d /homeassistant ]; then
|
||||||
if [ -d /config/addons_config ]; then
|
if [ -d /config/addons_config ]; then
|
||||||
rm -r /config/addons_config
|
rm -r /config/addons_config
|
||||||
fi
|
fi
|
||||||
|
if [ -d /config/addon_configs ]; then
|
||||||
|
rm -r /config/addon_configs
|
||||||
|
fi
|
||||||
if [ -d /config/addons_autoscripts ]; then
|
if [ -d /config/addons_autoscripts ]; then
|
||||||
rm -r /config/addons_autoscripts
|
rm -r /config/addons_autoscripts
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create symlinks with legacy folders
|
# Create symlinks with legacy folders
|
||||||
|
addon_configs_symlink_dir=""
|
||||||
if [ -d /homeassistant/addons_config ]; then
|
if [ -d /homeassistant/addons_config ]; then
|
||||||
ln -s /homeassistant/addons_config /config
|
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
|
fi
|
||||||
if [ -d /homeassistant/addons_autoscripts ]; then
|
if [ -d /homeassistant/addons_autoscripts ]; then
|
||||||
ln -s /homeassistant/addons_autoscripts /config
|
ln -s /homeassistant/addons_autoscripts /config
|
||||||
|
|||||||
Reference in New Issue
Block a user