root/trunk/freewrt/scripts/restore-defaultconf.sh

Revision 2227, 359 bytes (checked in by tg, 2 years ago)

revert 2219, sorry dnehring@ you were wrong
read the list of “patterns” in mk/build.mk then you'll understand

Line 
1 # $FreeWRT$
2
3 # restore patterns given in $@
4 # in .config using defaults found
5 # in Config.default.
6
7 restore() { # (pattern)
8         printf ',g/%s/d\nwq\n' "$1" | ed -s .config || return 1
9         grep "$1" Config.default >>.config
10         return $?
11 }
12
13 for pattern in "$@" ; do
14         restore "$pattern" || echo "WARNING: internal restoring of defaults by pattern $pattern failed!"
15 done
Note: See TracBrowser for help on using the browser.