Forum Moderators: bakedjake
I realize there are tools like RSTunnel and autossh, but I'm wondering how one goes about determining, via a script, if a session/process is still running.
Thanks,
Chris
I have a feeling that there is more to this, but I've definitely made some progress.
Here is what I have thus far (comments/suggestions welcome):
#!/bin/bash
while true
do
if ps aux ¦ grep [y]ourdomain
then
echo "SSH connection up."
else
echo "SSH connection down."
echo "Trying to connect ..."
ssh -N -f -R 3307:localhost:3306 user@www.yourdomain.com
fi
sleep 60
done