mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-28 11:24:04 +02:00
Update and rename 20-folders.sh to 00-folders.sh
This commit is contained in:
@@ -2,19 +2,18 @@
|
|||||||
|
|
||||||
CONFIGLOCATION=$(bashio::config "CONFIG_LOCATION")
|
CONFIGLOCATION=$(bashio::config "CONFIG_LOCATION")
|
||||||
|
|
||||||
|
sed -i "s| /data/config| $CONFIGLOCATION|g" /etc/cont-init.d/* \
|
||||||
|
sed -i "s| /data/config| $CONFIGLOCATION|g" /defaults/* || true
|
||||||
|
|
||||||
# Create directory
|
# Create directory
|
||||||
mkdir -p $CONFIGLOCATION/config
|
mkdir -p $CONFIGLOCATION/config
|
||||||
|
|
||||||
# Copy previous config if existing
|
# Copy previous config if existing
|
||||||
unlink /data/config 2>/dev/null || true
|
|
||||||
if [ -d /data/config ]; then
|
if [ -d /data/config ]; then
|
||||||
echo "Moving to new location $CONFIGLOCATION"
|
echo "Moving to new location $CONFIGLOCATION"
|
||||||
mv /data/config/* $CONFIGLOCATION/config/
|
mv /data/config/* $CONFIGLOCATION/config/
|
||||||
rm -r /data/config
|
rm -r /data/config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make symlinks
|
|
||||||
ln -s $CONFIGLOCATION/config /data/config
|
|
||||||
|
|
||||||
# Make sure permissions are right
|
# Make sure permissions are right
|
||||||
chown -R $(id -u):$(id -g) $CONFIGLOCATION
|
chown -R $(id -u):$(id -g) $CONFIGLOCATION
|
||||||
Reference in New Issue
Block a user