From 629b5c0767c8557ab688582bb6bd86c448f8c243 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 21 Jul 2005 14:02:53 +0000 Subject: add config file /etc/config/network, add board-specific network.overrides (instead of nvram.overrides) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1519 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- openwrt/package/base-files/default/etc/functions.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'openwrt/package/base-files/default/etc/functions.sh') diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh index 60d6231f8..14f5011db 100755 --- a/openwrt/package/base-files/default/etc/functions.sh +++ b/openwrt/package/base-files/default/etc/functions.sh @@ -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 () ( -- cgit v1.2.3