only commit nvram if necessary (fixes #74)
authorFelix Fietkau <nbd@openwrt.org>
Sun, 11 Dec 2005 22:11:57 +0000 (22:11 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 11 Dec 2005 22:11:57 +0000 (22:11 +0000)
SVN-Revision: 2623

openwrt/package/webif/files/usr/lib/webif/apply.sh

index fdcb4c324ae10b3d55ab82ffd7ffa21f13e0ca18..8cafa4fa92e3f7ac859081cc9dd9d722651efd25 100644 (file)
@@ -56,10 +56,12 @@ done
 # config-*             simple config files
 [ -f /etc/nvram.overrides ] && ( # White Russian
        cd /proc/self
-       cat /tmp/.webif/config-* 2>&- | tee fd/1 | xargs -n1 nvram set
+       cat /tmp/.webif/config-* 2>&- | grep '=' >&- 2>&- && {
+               cat /tmp/.webif/config-* 2>&- | tee fd/1 | xargs -n1 nvram set
+               echo "Committing NVRAM ..."
+               nvram commit
+       }
 )
-echo "Committing NVRAM ..."
-nvram commit
 for config in $(ls config-* 2>&-); do 
        name=${config#config-}
        eval 'case "$name" in