diff options
Diffstat (limited to 'openwrt/rhctl/files/serialclient.init')
-rw-r--r-- | openwrt/rhctl/files/serialclient.init | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/openwrt/rhctl/files/serialclient.init b/openwrt/rhctl/files/serialclient.init index d869d25..39665b2 100644 --- a/openwrt/rhctl/files/serialclient.init +++ b/openwrt/rhctl/files/serialclient.init @@ -17,7 +17,7 @@ option_cb() { } foreach_config_forced() { - foreach_config $1 "forced" + foreach_config $1 "$2" "forced" } foreach_config() { @@ -28,16 +28,20 @@ foreach_config() { local args="" local forced=0 - if [ -n "$2" ] && [ "x$2" == "xforced" ]; then + config_get name "$cfg" "name" + if [ -n "$2" ] && [ "x$2" != "x$name" ]; then + return + fi + + if [ -n "$3" ] && [ "x$3" == "xforced" ]; then forced=1 fi - config_get name "serialclient" "name" for option in $CONFIG_OPTIONS do - config_get value "serialclient" "$option" + config_get value "$cfg" "$option" if [ "x$option" == "xdisabled" ]; then - if [ $forced -eq 0 ] && [ $value -eq 1 ]; then + if [ $forced -eq 0 ] && [ -n "$value" ] && [ $value -eq 1 ]; then echo -n " $name(disabled)" return fi @@ -78,11 +82,11 @@ start() { config_load "rhctl" if [ $# -gt 0 ]; then while [ $# -gt 0 ]; do - config_foreach foreach_config_forced "$1" + config_foreach foreach_config_forced "serialclient" "$1" shift done else - config_foreach foreach_config "" + config_foreach foreach_config "serialclient" fi echo "." } |