diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-02-27 23:09:57 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-02-27 23:09:57 +0000 |
commit | f8e0bf987f94b7843f6f03864e4f290d5fbe1356 (patch) | |
tree | 30c13091c7b3c75cd92ee3e38197776a92c05012 | |
parent | 1ec4cebdefbac67c1a15cec513dbd32d4de187b5 (diff) | |
download | upstream-f8e0bf987f94b7843f6f03864e4f290d5fbe1356.tar.gz upstream-f8e0bf987f94b7843f6f03864e4f290d5fbe1356.tar.bz2 upstream-f8e0bf987f94b7843f6f03864e4f290d5fbe1356.zip |
move config_get_bool from /sbin/wifi to /etc/functions.sh
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6407 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-x | package/base-files/files/etc/functions.sh | 11 | ||||
-rwxr-xr-x | package/base-files/files/sbin/wifi | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 84121c5458..931f4be472 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -105,6 +105,17 @@ config_get() { esac } +# config_get_bool <variable> <section> <option> [<default>] +config_get_bool() { + local _tmp + config_get "_tmp" "$2" "$3" + case "$_tmp" in + 1|on|enabled) export ${NO_EXPORT:+-n} "$1=1";; + 0|off|disabled) export ${NO_EXPORT:+-n} "$1=0";; + *) eval "$1=${4:-0}";; + esac +} + config_set() { local section="$1" local option="$2" diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 272aa16fa3..2b4f1ce1c2 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -78,17 +78,6 @@ start_net() {( setup_interface "$1" "$2" )} -config_get_bool() { - local _tmp - config_get "$1" "$2" "$3" - eval "_tmp=\$$1" - case "$_tmp" in - 1|on|enabled) eval "$1=1";; - 0|off|disabled) eval "$1=0";; - *) eval "$1=${4:-0}";; - esac -} - config_cb() { config_get TYPE "$CONFIG_SECTION" TYPE case "$TYPE" in |