]> code.delx.au - monosys/blob - bin/ssh-screen-wrapper
99b2f2fef79ce6fad6ec356ed98f2f2d2d755a48
[monosys] / bin / ssh-screen-wrapper
1 #!/bin/bash -e
2
3 hostname="$(basename "$0")"
4 local_hostname="${hostname}.localnet"
5 public_hostname="p${hostname}"
6
7 if grep -q "^Host ${hostname}$" ~/.ssh/config; then
8 true
9 elif ping -c1 -t1 "$local_hostname" &> /dev/null; then
10 hostname="$local_hostname"
11 else
12 hostname="$public_hostname"
13 fi
14
15 exec ssh "$hostname" "$@" -t screen -dR
16