mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
35 lines
721 B
Bash
35 lines
721 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
|
|
|
|
[ -d "/lib/config/snapshots/first_boot/uci" ] || exit 0
|
|
|
|
# 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.
|
|
logger -s -p daemon.info -t post-hooks -- "UCI wireless migrated."
|
|
|
|
exit 0
|
|
|