Update 20-folders.sh

https://github.com/alexbelgium/hassio-addons/issues/163
This commit is contained in:
Alexandre
2022-01-15 16:26:19 +01:00
committed by GitHub
parent 74bd9c43f7
commit d81f98b369

View File

@@ -1,17 +1,19 @@
#!/usr/bin/env bashio
CONFIGLOCATION=$(bashio::config "CONFIG_LOCATION")
# Create directory
mkdir -p /config/addons_config/papermerge/config
mkdir -p $CONFIGLOCATION/config
# Copy previous config if existing
if [ -d /data/config ]; then
echo "Moving to new location /config/addons_config/papermerge"
mv /data/config/* /config/addons_config/papermerge/config/
echo "Moving to new location $CONFIGLOCATION"
mv /data/config/* $CONFIGLOCATION/config/
rm -r /data/config
fi
# Make symlinks
ln -snf -T /config/addons_config/papermerge /data/config
ln -snf -T $CONFIGLOCATION/config /data/config
# Make sure permissions are right
chown -R $(id -u):$(id -g) /config/addons_config/papermerge
chown -R $(id -u):$(id -g) $CONFIGLOCATION