summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-02-27 23:09:57 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-02-27 23:09:57 +0000
commit796420d4282fc8765dd6d0b0cc11507482ef5d35 (patch)
tree30c13091c7b3c75cd92ee3e38197776a92c05012 /package/base-files/files/etc
parentebd4cdb1205e93b0aa309d559c84e7370e7fd4a2 (diff)
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
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-xpackage/base-files/files/etc/functions.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh
index 84121c545..931f4be47 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"