The command config_get_bool allows a fourth parameter which defines a default value. At many places it would be very useful if the plain three-parameter version of config get supported such a parameter as well, that saves a bunch of [ -z "$foo" ] checks in my scripts.
In bug 5636  you can find some patches: The first  introduces an optional fourth parameter to config_get. That patch could be backported to 8.09 branch. The next four patches [2,3,4,5] apply this four-parameter version in functions.sh, init.d/boot, init.d/led and init.d/fstab. Finally there's another patch  to /lib/network/config.sh which also includes some refactoring moving around some code and localizes a lot of variables which weren't so before. The changes don't spread over more than two hunks per refactoring. Cheers, Malte https://dev.openwrt.org/ticket/5636 https://dev.openwrt.org/attachment/ticket/5636/0001--package-base-files- allow-default-value-for-config.patch https://dev.openwrt.org/attachment/ticket/5636/0002--package-base-files- port-functions.sh-to-new-confi.patch https://dev.openwrt.org/attachment/ticket/5636/0003--package-base-files- port-init.d-boot-to-new-config.patch https://dev.openwrt.org/attachment/ticket/5636/0004--package-base-files- port-init.d-led-to-new-config_.patch https://dev.openwrt.org/attachment/ticket/5636/0005--package-base-files- clean-up-init.d-fstab-and-port.patch https://dev.openwrt.org/attachment/ticket/5636/0006--package-base-files- some-lib-network-config.sh-re.patch -- _______________________________________________ openwrt-devel mailing list email@example.com https://lists.openwrt.org/mailman/listinfo/openwrt-devel