Skip to content

Instantly share code, notes, and snippets.

@dan82840
Last active August 15, 2018 09:36
Show Gist options
  • Save dan82840/af30b688c62590c07a538973bdb2abf7 to your computer and use it in GitHub Desktop.
Save dan82840/af30b688c62590c07a538973bdb2abf7 to your computer and use it in GitHub Desktop.
test-oap-state.sh
#!/bin/sh
#
. /lib/oap/uci.sh
_foreach_wifi_iface_cb() {
local section=$1
local ifname=$(oap_state_get wireless.$section.ifname)
local ssid=$(oap_state_get wireless.$section.ssid)
echo "$section:<$ifname>:$ssid"
oap_state_set wireless.$section.section $section
oap_state_del wireless.$section.section
}
main() {
oap_state_foreach wireless wifi-iface _foreach_wifi_iface_cb
}
main
exit 0
@dan82840
Copy link
Author

dan82840 commented Aug 15, 2018

# test-oap-state.sh
2gr:<ath0>:XXX
guest:<ath01>:DropAP-Guest-f88f02
5gr:<ath1>:DropAP-f88f02-5G
@wifi-iface[0]:<ath0>:XXX
@wifi-iface[1]:<ath01>:DropAP-Guest-f88f02
@wifi-iface[2]:<ath1>:DropAP-f88f02-5G
@wifi-iface[3]:<ath02>:OpenWrt3
@wifi-iface[4]:<ath03>:OpenWrt4
@wifi-iface[5]:<ath04>:OpenWrt5
@wifi-iface[6]:<>:OpenWrt6
@wifi-iface[7]:<ath05>:OpenWrt7
@wifi-iface[8]:<ath06>:OpenWrt8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment