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