ucidef_add_switch() {
local name="$1"
- local reset="$2"
- local enable="$3"
json_select_object switch
-
- json_select_object "$name"
- json_add_boolean enable "$enable"
- json_add_boolean reset "$reset"
- json_select ..
-
+ json_select_object "$name"
+ json_add_boolean enable 1
+ json_add_boolean reset 1
+ json_select ..
json_select ..
}
local val="$3"
json_select_object switch
- json_select_object "$name"
+ json_select_object "$name"
- case "$val" in
- [0-9]) json_add_int "$key" "$val" ;;
- *) json_add_string "$key" "$val" ;;
- esac
+ case "$val" in
+ true|false) [ "$val" != "true" ]; json_add_boolean "$key" $? ;;
+ [0-9]) json_add_int "$key" "$val" ;;
+ *) json_add_string "$key" "$val" ;;
+ esac
- json_select ..
+ json_select ..
json_select ..
}
json_select_object attr
case "$val" in
+ true|false) [ "$val" != "true" ]; json_add_boolean "$key" $? ;;
[0-9]) json_add_int "$key" "$val" ;;
*) json_add_string "$key" "$val" ;;
esac
dlan-pro-1200-ac)
ucidef_set_interface_lan "eth0"
- ucidef_add_switch "switch0" "1" "0"
+ ucidef_add_switch "switch0"
+ ucidef_add_switch_attr "switch0" "reset" "false"
ucidef_add_switch_ports "switch0" \
"0@eth0" "2:lan" "3:lan" "4:lan"
;;
w150m|\
wnce2001|\
zte-q7)
- ucidef_add_switch "switch0" "1" "0"
+ ucidef_add_switch "switch0"
+ ucidef_add_switch_attr "switch0" "reset" "false"
ucidef_set_interface_lan "eth0"
;;
3g-6200nl|\
"1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0"
;;
m2m)
- ucidef_add_switch "switch0" "4"
+ ucidef_add_switch "switch0"
+ ucidef_add_switch_attr "switch0" "reset" "false"
ucidef_set_interface_lan "eth0"
;;
mlwg2|\