diff options
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-x | package/base-files/files/etc/functions.sh | 11 |
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 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" |