Files
hassio-addons/calibre_web/rootfs/etc/cont-init.d/00-a_migrate.sh
2025-07-23 08:58:09 +00:00

16 lines
493 B
Bash
Executable File

#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
####################
# Migrate database #
####################
if [ -d /homeassistant/addons_config/calibre-web ] && [ ! -L /homeassistant/addons_config/calibre-web ]; then
if [ "$(ls -A /homeassistant/addons_config/calibre-web)" ]; then
echo "Moving database to new location /config"
cp -rf /homeassistant/addons_config/calibre-web/* "$LOCATION"/
fi
rm -r /homeassistant/addons_config/calibre-web
fi