#!/bin/bash

. ~/autossh-conf.sh

NLINES=`ps aux | grep "$TUNNEL" | grep -v "grep" | wc -l`

if [ $NLINES -eq 0 ]
then
    echo "connexion $MYSSHCMD"
    ssh -NTR ${TUNNEL} -p ${REMOTEPORT} ${REMOTEUSER}@${REMOTEHOST}
fi
exit 0
