summaryrefslogtreecommitdiff
path: root/files/common/openwrt/list-stations
diff options
context:
space:
mode:
Diffstat (limited to 'files/common/openwrt/list-stations')
-rw-r--r--files/common/openwrt/list-stations14
1 files changed, 14 insertions, 0 deletions
diff --git a/files/common/openwrt/list-stations b/files/common/openwrt/list-stations
new file mode 100644
index 00000000..6cd21671
--- /dev/null
+++ b/files/common/openwrt/list-stations
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+interfaces=$(iw dev | grep "Interface " | cut -d ' ' -f2 | sort)
+
+for interface in $interfaces; do
+ bssid=$(iw $interface info | grep "addr " | cut -d ' ' -f2)
+ essid=$(iw $interface info | grep "ssid " | cut -d ' ' -f2-)
+ channel=$(iw $interface info | grep "channel " | cut -d ' ' -f2-)
+ echo "$interface ($bssid, ssid: '$essid', channel: $channel)"
+ iw $interface station dump | grep "^Station" | awk '{ print(" - "$2) }'
+ echo ""
+done
+
+exit 0