]> code.delx.au - monosys/blobdiff - hacks/fix-openwrt-hairpin
fix-openwrt-hairpin
[monosys] / hacks / fix-openwrt-hairpin
diff --git a/hacks/fix-openwrt-hairpin b/hacks/fix-openwrt-hairpin
new file mode 100755 (executable)
index 0000000..43cf038
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+AP_HOSTS="$(awk '/^Host.*openwrt/ {print $2}' < ~/.ssh/config | grep -v router)"
+
+for host in $AP_HOSTS; do
+    ssh "$host" 'for f in /sys/devices/virtual/net/*/*wlan*/brport/hairpin_mode; do echo 1 > "$f"; done'
+done
+