Maybe you just can't have it run in the background.
I also made a thing on the remote host I called "sleepy"
while :
do
sleep 500
done
and then I did the ssh -l <blah blah blah> $OUTSIDEIP sleepy
to make sure it would run something and not log me off.
Same problem, AND when I killed the task, sleepy kept
running on the remote machine.
He's probably better off with -f and no ampersand, because that will 1)
attach stdin from /dev/null like -n does and 2) fork off into the
background only _after_ the ssh connection is up. Without that
synchronisation (plain "&" approach) his script may start the other
tunneled ssh commands before the ssh tunnel itself is up. And it has the
bonus that you can test if the tunnel came up:
if ssh -f .....
then
tunnel-using-ssh-commands-here...
else
whoops, main ssh failed for some reason
fi
Cheers,
--