X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/3d007394805916ceb2214bfd7e06d8a4899262c5..a33d85b6e67a1b7f8f9ded6c387b8cfcbf18089f:/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 () (