xanadu|02:48:54|:/etc/init.d# cat ssh2 #!/bin/sh # /etc/init.d/ssh-1: start and stop the OpenBSD "secure shell(tm)" daemon # Configurable options: DIR="/var/run/sshd2" PID="/var/run/sshd2.pid" CFG="-f /etc/ssh/sshd2_config" test -x /usr/sbin/sshd || exit 0 ( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists if [ -e /etc/ssh/sshd_not_to_be_run ]; then echo "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" exit 0 fi check_config() { /usr/sbin/sshd2 -t $CFG || exit 1 } case "$1" in start) test -f /etc/ssh/sshd_not_to_be_run && exit 0 #Create the PrivSep empty dir if necessary if [ ! -d $DIR ]; then mkdir $DIR ; chmod 0755 $DIR fi echo -n "Starting ssh server: sshd2" start-stop-daemon --start --quiet --pidfile $PID --exec /usr/sbin/sshd2 -- $CFG echo "." ;; stop) echo -n "Stopping ssh server: sshd2" start-stop-daemon --stop --quiet --oknodo --pidfile $PID echo "." ;; reload|force-reload) test -f /etc/ssh/sshd_not_to_be_run && exit 0 check_config echo -n "Reloading ssh server's configuration" start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PID --ex ec /usr/sbin/sshd2 -- $CFG echo "." ;; restart) test -f /etc/ssh/sshd_not_to_be_run && exit 0 check_config echo -n "Restarting OpenBSD Secure Shell server: sshd" start-stop-daemon --stop --quiet --oknodo --pidfile $PID sleep 2 start-stop-daemon --start --quiet --pidfile $PID --exec /usr/sbin/sshd2 - - $CFG echo "." ;; *) echo "Usage: /etc/init.d/ssh2 {start|stop|reload|force-reload|restart}" exit 1 esac exit 0