aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/default/etc/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/default/etc/functions.sh')
-rwxr-xr-xpackage/base-files/default/etc/functions.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh
index 60d6231f8a..14f5011db7 100755
--- a/package/base-files/default/etc/functions.sh
+++ b/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 () (