From: James Bunton Date: Sat, 17 Feb 2024 01:32:14 +0000 (+1100) Subject: fix-openwrt-hairpin: run on openwrt AP itself X-Git-Url: https://code.delx.au/monosys/commitdiff_plain/02bac4f297ff6ec3f55278372cae905d0bd812bc fix-openwrt-hairpin: run on openwrt AP itself --- diff --git a/hacks/fix-openwrt-hairpin b/hacks/fix-openwrt-hairpin index 9403ffe..7428461 100755 --- a/hacks/fix-openwrt-hairpin +++ b/hacks/fix-openwrt-hairpin @@ -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 -