]> code.delx.au - monosys/blobdiff - hacks/ssh-screen-wrapper
ssh-screen-wrapper: more flexible line matching
[monosys] / hacks / ssh-screen-wrapper
index 662f08c1b6a63a90c824013bc2768ecabe558f4d..fe083cc5eb0206c50ea5d461bde7efa428390fba 100755 (executable)
@@ -6,7 +6,7 @@ hostname="$(basename "$0")"
 local_hostname="${hostname}.localnet"
 public_hostname="p${hostname}"
 
-if grep -q "^Host ${hostname}$" ~/.ssh/config; then
+if grep -Eq "^Host ${hostname}\b" ~/.ssh/config; then
     true
 elif ping -c1 -t1 "$local_hostname" &> /dev/null; then
     hostname="$local_hostname"