Script : keep your connection on a remote shell

A script to launch if you doesn't want to be disconnected by timeout on your remote ssh connection :

#!/usr/bin/ksh
#####################################################################
# Program : Keep-Hand
#
# Version : V2.0
# Date : 2009-02-11
# Author : N. PENE
#
# Inputs : none
#####################################################################


while [ 1 -eq 1 ] ; do

#-- check if the code is attached to an xterm :
term=`ps -p $$ | cut -d " " -f 2`
if [ $term == "?" ] ; then
exit
fi

#-- wait 4min :
sleep 240
echo -e ".\c"
done

No comments: