base-files: define yes/no as valid boolean options
authorLuka Perkov <luka@openwrt.org>
Sun, 29 Jun 2014 23:05:05 +0000 (23:05 +0000)
committerLuka Perkov <luka@openwrt.org>
Sun, 29 Jun 2014 23:05:05 +0000 (23:05 +0000)
ubox validate_data defines yes/no as valid boolean options, do the same in
config_get_bool too.

Signed-off-by: Luka Perkov <luka@openwrt.org>
SVN-Revision: 41405

package/base-files/files/lib/functions.sh

index e55cad0b200275cdbbe4d08bad13fad24d45c6a4..0d4b2a33dbbf4e18acd474ae2adaad0ea3c1c4a0 100755 (executable)
@@ -102,8 +102,8 @@ config_get_bool() {
        local _tmp
        config_get _tmp "$2" "$3" "$4"
        case "$_tmp" in
-               1|on|true|enabled) _tmp=1;;
-               0|off|false|disabled) _tmp=0;;
+               1|on|true|yes|enabled) _tmp=1;;
+               0|off|false|no|disabled) _tmp=0;;
                *) _tmp="$4";;
        esac
        export ${NO_EXPORT:+-n} "$1=$_tmp"