]> code.delx.au - monosys/commitdiff
fix-openwrt-hairpin
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 14 Jun 2021 05:07:56 +0000 (15:07 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 14 Jun 2021 05:07:56 +0000 (15:07 +1000)
hacks/fix-openwrt-hairpin [new file with mode: 0755]

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
+