- end)
- elseif dir == "down" then
- uci:foreach("wireless", "wifi-iface", function(s)
- iface = s.network
- if iface == trmiface then
- section = s['.name']
- if cfg == section then
- idx = s['.index']
- else
- idx_change = s['.index']
- end
- if idx ~= "" and idx_change ~= "" and idx_change > idx then
- uci:reorder("wireless", cfg, idx_change)
- idx = ""
- end
+ if (dir == "up" and idx ~= "" and idx_change ~= "" and idx_change < idx) or
+ (dir == "down" and idx ~= "" and idx_change ~= "" and idx_change > idx) then
+ changed = uci:reorder("wireless", cfg, idx_change)
+ idx = ""