add config file /etc/config/network, add board-specific network.overrides (instead...
[openwrt.git] / package / base-files / default / etc / functions.sh
index 60d6231..14f5011 100755 (executable)
@@ -4,12 +4,18 @@ alias debug=${DEBUG:-:}
 
 # allow env to override nvram
 nvram () {
-  case $1 in
-    get) eval "echo \${NVRAM_$2:-\$(command nvram get $2)}";;
-    *) command nvram $*;;
-  esac
+  if [ -x /usr/sbin/nvram ]; then
+    case $1 in
+      get) eval "echo \${$2:-\$(command nvram get $2)}";;
+      *) command nvram $*;;
+    esac
+  else
+    case $1 in
+      get) eval "echo \${$2:-\${DEFAULT_$2}}";;
+      *);;
+    esac
+  fi  
 }
-. /etc/nvram.overrides
 
 # valid interface?
 if_valid () (
This page took 0.020605 seconds and 4 git commands to generate.