summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default/etc/nvram.sh
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/package/base-files/default/etc/nvram.sh')
-rw-r--r--openwrt/package/base-files/default/etc/nvram.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/openwrt/package/base-files/default/etc/nvram.sh b/openwrt/package/base-files/default/etc/nvram.sh
new file mode 100644
index 0000000000..f1170ac470
--- /dev/null
+++ b/openwrt/package/base-files/default/etc/nvram.sh
@@ -0,0 +1,17 @@
+#!/bin/ash
+
+# allow env to override nvram
+nvram () {
+ 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
+}
+