From 7a6a5531ccdccb3bd07acc2d84393f5efdad2481 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Wed, 22 Jun 2022 21:03:08 +1000 Subject: [PATCH] fix-openwrt-hairpin: error checking --- hacks/fix-openwrt-hairpin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.2