]> code.delx.au - monosys/commitdiff
fix-openwrt-hairpin: run on openwrt AP itself
authorJames Bunton <jamesbunton@delx.au>
Sat, 17 Feb 2024 01:32:14 +0000 (12:32 +1100)
committerJames Bunton <jamesbunton@delx.au>
Sat, 17 Feb 2024 01:32:14 +0000 (12:32 +1100)
hacks/fix-openwrt-hairpin

index 9403ffee3ff875ccae60126ee40aa6bf32ee0182..74284616984f550d5b2272a2e48cd87723b876d7 100755 (executable)
@@ -1,8 +1,11 @@
 #!/bin/bash
 
-AP_HOSTS="$(awk '/^Host.*openwrt/ {print $2}' < ~/.ssh/config)"
+# /etc/crontabs/root
+# m  h dom mon dow command
+# *  *  *   *   *  /root/fix-openwrt-hairpin
 
-for host in $AP_HOSTS; do
-    ssh "$host" 'for f in /sys/devices/virtual/net/*/*wlan*/brport/hairpin_mode; do [ -f $f ] && echo 1 > "$f"; done'
+for f in /sys/devices/virtual/net/*/*wlan*/brport/hairpin_mode; do
+    if [ -f $f ]; then
+        echo 1 > "$f"
+    fi
 done
-