bash: tcp-tunnel.sh: clean up the socket files before sleep

In this way, when the user SIGINTs during the sleep, we have already cleaned up.
This commit is contained in:
Alan Faubert 2023-09-03 07:18:05 -04:00
parent 91d033a013
commit d1369149b2

View File

@ -32,7 +32,7 @@ while [ "$1" ] && [ "$2" ]; do
done
>&2 echo "> ssh$tun $server"
while :; do
sleep 1
[ "$del" ] && ssh -o ConnectTimeout=10 $server mkdir -m 700 -p .tcp-tunnel $del
sleep 1
ssh -o ConnectTimeout=10 -o ExitOnForwardFailure=yes -o ServerAliveCountMax=1 -o ServerAliveInterval=30 $tun $server
done