]>
code.delx.au - monosys/blob - ssh-screen-wrapper
3 hostname
="$(basename "$0")"
4 local_hostname
="${hostname}.localnet"
5 public_hostname
="p${hostname}"
7 if grep -q "^Host ${hostname}$" ~
/.ssh
/config
; then
9 elif ping -c1 -t1 "$local_hostname" &> /dev
/null
; then
10 hostname
="$local_hostname"
12 hostname
="$public_hostname"
17 echo "Connecting to ${hostname}..."
19 -o ServerAliveInterval
=1 \
20 -o ServerAliveCountMax
=5 \
23 "bash --login -c 'screen -dR'" \
25 echo "Disconnected, waiting..."
26 echo -ne "\033]0;${hostname}: disconnected!\007"