summaryrefslogtreecommitdiffstats
path: root/package/base-files/default/etc/nvram.sh
blob: f1170ac470fa8c2840a16fb5d8d2297c5c4a0ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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  
}