7 PIDDIR
="/var/run/autosshd"
8 [ -d "$PIDDIR" ] || mkdir
-p $PIDDIR
9 PIDFILE
="$PIDDIR/autosshd.pid"
10 PID
=$
(cat "$PIDFILE" 2>/dev
/null
)
14 stat_busy
"Starting autossh"
15 [ "$AUTOSSH_USER" == "" ] || chown
-R $AUTOSSH_USER $PIDDIR
16 [ -z "$PID" ] && sudo
-u $AUTOSSH_USER env AUTOSSH_PIDFILE
="$PIDFILE" /usr
/bin
/autossh
-M $AUTOSSH_PORT -f $SSH_OPTIONS
25 stat_busy
"Stopping autossh"
26 if [ -n "$PID" ]; then
27 kill $PID &> /dev
/null
44 if [ -z "$PID" ]; then
51 echo "usage: $0 {start|stop|status|restart}"