From: James Bunton Date: Wed, 22 Jun 2022 11:03:08 +0000 (+1000) Subject: fix-openwrt-hairpin: error checking X-Git-Url: https://code.delx.au/monosys/commitdiff_plain/7a6a5531ccdccb3bd07acc2d84393f5efdad2481 fix-openwrt-hairpin: error checking --- diff --git a/hacks/fix-openwrt-hairpin b/hacks/fix-openwrt-hairpin index 43cf038..9403ffe 100755 --- a/hacks/fix-openwrt-hairpin +++ b/hacks/fix-openwrt-hairpin @@ -1,8 +1,8 @@ #!/bin/bash -AP_HOSTS="$(awk '/^Host.*openwrt/ {print $2}' < ~/.ssh/config | grep -v router)" +AP_HOSTS="$(awk '/^Host.*openwrt/ {print $2}' < ~/.ssh/config)" for host in $AP_HOSTS; do - ssh "$host" 'for f in /sys/devices/virtual/net/*/*wlan*/brport/hairpin_mode; do echo 1 > "$f"; done' + ssh "$host" 'for f in /sys/devices/virtual/net/*/*wlan*/brport/hairpin_mode; do [ -f $f ] && echo 1 > "$f"; done' done