iopsys-feed/wifimngr/files/214-uci-wireless
2020-03-29 12:22:47 +02:00

34 lines
640 B
Bash

#!/bin/sh
# As part of sysupgrade we migrate the users custom changes to the
# new fs. (Those which differ from the first boot defaults.)
# Abort on any error.
set -e
# Do nothing if user want to discard old settings.
if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then
exit 0
fi
# Source functions.
for f in /lib/upgrade/iopsys*.sh; do
[ -r "$f" -a -s "$f" ] || continue
source $f
done
# Does this system has WiFi?
hasWifi=$(chroot "${2}" db -q get hw.board.hasWifi)
[ "$hasWifi" = "1" ] || exit 0
uci_possibly_migrate_package "wireless" "$2" || exit
# Report success.
log "post-hooks" "UCI wireless migrated."
exit 0