add sysupgrade script for config preserving system upgrades. only implemented for...
[openwrt.git] / package / base-files / files / etc / preinit
index c11732f..452209f 100755 (executable)
@@ -60,6 +60,14 @@ echo "$HOTPLUG" > /proc/sys/kernel/hotplug
 eval ${FAILSAFE:+failsafe}
 lock -w /tmp/.failsafe
 mount_root
+[ -f /sysupgrade.tgz ] && {
+       echo "- config restore -"
+       cd /
+       mv sysupgrade.tgz /tmp
+       tar xzf /tmp/sysupgrade.tgz
+       rm -f /tmp/sysupgrade.tgz
+       sync
+}
 
 echo "- init -"