inteno-netmode: support netmode-conf without band (apply to both) ref #12898

This commit is contained in:
Reidar Cederqvist 2017-09-20 11:34:07 +02:00
parent 7b1f241dda
commit fe23056560

View file

@ -150,12 +150,12 @@ local dummy band ssid key encryption device iface_num
while json_get_var dummy $i; do
json_select $i
json_get_var band band
[ "$apcliband" == "$band" ] && break
[ "$band" == "" -o "$apcliband" == "$band" ] && break
json_select ..
i=$((i+1))
done
[ "$apcliband" == "$band" ] || {
[ "$apcliband" == "$band" -o "$band" == "" ] || {
[ "$from_gui" == "true" ] && restore "back"
exit
}
@ -184,6 +184,27 @@ i=1
while json_get_var dummy $i; do
json_select $i
json_get_var band band
json_get_var ssid ssid
json_get_var encryption encryption
json_get_var key key
if [ "$band" == "" ]; then
get_device "a" device
get_iface_num "$device" "$a_num" iface_num
a_num=$((a_num+1))
[ -z $iface_num ] && {
[ "$from_gui" == "true" ] && restore "back"
exit
}
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
get_device "b" device
get_iface_num "$device" "$b_num" iface_num
b_num=$((b_num+1))
[ -z $iface_num ] && {
[ "$from_gui" == "true" ] && restore "back"
exit
}
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
else
get_device "$band" device
case $band in
a)
@ -199,14 +220,14 @@ while json_get_var dummy $i; do
[ "$from_gui" == "true" ] && restore "back"
exit
}
json_get_var ssid ssid
json_get_var encryption encryption
json_get_var key key
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
json_select ..
fi
i=$((i+1))
json_select ..
done
i=$((b_num + a_num + 1))
if [ $repeater_iface_num -gt $i ]; then
i=$((i-1))
fi