Use systemd for config mount (#37)

* Create mnt-config.mount

* Update hassos-config

* Update mnt-config.mount

* Update hassos-config
This commit is contained in:
Pascal Vizeli
2018-06-26 10:18:16 +02:00
committed by GitHub
parent 42f1c4bf01
commit 27cd425f5b
2 changed files with 14 additions and 9 deletions

View File

@@ -1,15 +1,12 @@
#!/bin/sh
set -e
# Check if hassos-config is present
if ! findfs LABEL="hassos-config" > /dev/null; then
echo "[Warning] No hassos-config partition found!"
# Mount config folder
systemctl start mnt-config.mount
if ! systemctl -q is-active mnt-config.mount; then
echo "[Warning] No config partition found"
exit 0
fi
# Mount config partition
mount -o ro LABEL="hassos-config" /mnt/config
##
# NetworkManager
if [ -d /mnt/config/network ]; then
@@ -18,7 +15,7 @@ if [ -d /mnt/config/network ]; then
rm -rf /etc/NetworkManager/system-connections/*
cp -f /mnt/config/network/* /etc/NetworkManager/system-connections/
nmcli con reload || true
nmcli con reload
fi
##
@@ -54,4 +51,4 @@ if ls /mnt/config/*.raucb > /dev/null; then
fi
# Cleanup config partition
umount /mnt/config
systemctl stop mnt-config.mount