]> code.delx.au - monosys/blob - hacks/ssh-screen-wrapper
notes: fix raspi install notes, also @home -> @username
[monosys] / hacks / ssh-screen-wrapper
1 #!/bin/bash
2
3 set -eu
4
5 hostname="$(basename "$0")"
6
7 while true; do
8 clear
9 echo "Connecting to ${hostname}..."
10 ssh \
11 -o ServerAliveInterval=1 \
12 -o ServerAliveCountMax=5 \
13 -t \
14 "$@" \
15 "$hostname" \
16 "bash --login -c 'screen -dR'" \
17 && exit 0
18 echo "Disconnected, waiting..."
19 echo -ne "\\033]0;${hostname}: disconnected!\\007"
20 sleep 1
21 done
22