sysupgrade: uci wireless santity checks.

This commit is contained in:
Ronny Nilsson 2020-03-26 16:23:07 +01:00
parent 61c11e2520
commit 79f7343cb4

View file

@ -22,13 +22,18 @@ hasWifi=$(chroot "${2}" db -q get hw.board.hasWifi)
# Read the very first verion of the wireless settings.
chroot "${2}" uci -c "/lib/config/snapshots/first_boot/uci" \
show wireless >"/tmp/wireless-first-$$"
if ! chroot "${2}" uci -c "/lib/config/snapshots/first_boot/uci" \
-q show wireless >"/tmp/wireless-first-$$" || \
[ ! -s "/tmp/wireless-first-$$" ]; then
exit 0
fi
# Let the current UCI export its wireless settings.
chroot "${2}" uci show wireless >"/tmp/wireless-current-$$"
if ! chroot "${2}" uci -q show wireless >"/tmp/wireless-current-$$" || \
[ ! -s "/tmp/wireless-current-$$" ]; then
exit 0
fi
# If there a diff between the two?
if grep -vFf "/tmp/wireless-first-$$" "/tmp/wireless-current-$$" \