Add support for new config shema

This commit is contained in:
Pascal Vizeli 2018-06-03 14:29:25 +02:00 committed by GitHub
parent 8d7608d6c8
commit 42f195e91c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,15 +12,24 @@ mount -o ro LABEL="hassos-config" /mnt/config
##
# NetworkManager
if ls /mnt/config/network-* > /dev/null; then
if [ -d /mnt/config/network ]; then
echo "[Info] Update NetworkManager connections!"
rm -rf /etc/NetworkManager/system-connections/*
cp -f /mnt/config/network-* /etc/NetworkManager/system-connections/
cp -f /mnt/config/network/* /etc/NetworkManager/system-connections/
nmcli con reload || true
fi
##
# Modules
if [ -d /mnt/config/modules ]; then
echo "[Info] Update Modules configuration!"
rm -rf /etc/modules-load.d/*
cp -f /mnt/config/modules/* /etc/modules-load.d/*
fi
##
# SSH know hosts
if [ -f /mnt/config/known_hosts ]; then
@ -32,7 +41,12 @@ fi
##
# Firmware update
if ls /mnt/config/*.rauc > /dev/null; then
echo "[Info] Performe a firmware update"
rauc_filename=$(ls /mnt/config/*.rauc | head -n 1)
rauc install /mnt/config/$rauc_filename
fi
# Cleanup config partition
umount /mnt/config