#!/sbin/sh ## ## Startup/shutdown ssh ## pidfile=/var/run/sshd.pid prefix=/usr/local sbindir=${prefix}/sbin sshd=${sbindir}/sshd case "$1" in 'start') if [ -x ${sshd} ] ; then /usr/bin/echo "Starting OpenSSH... \c" ${sshd} echo "Done" fi ;; 'stop') /usr/bin/echo "Stopping OpenSSH... \c" ps -ael | grep ssh | awk '{print $4}' | grep -v $$ xargs kill echo "Done" ;; 'restart') /usr/bin/echo "Restarting OpenSSH... \c" kill -HUP `cat ${pidfile}` echo "Done" ;; '*') echo "Usage: $0 {start|stop|restart}" ;; esac