Files
hassio-addons/papermerge/rootfs/etc/cont-init.d/20-folders.sh

20 lines
449 B
Bash

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