return to first page linux journal archive
keywordscontents

Listing 3. Slackware ssh Script in /etc/init.d

#! /bin/sh
12345678901234567890123456789012345678901234567890
# /etc/init.d/ssh: start and stop the 
# "gsecure shell(tm)" daemon
test -x /usr/sbin/sshd || exit 0
# Configurable options:
case "g$1" in
  start)
     start-stop-daemon --start --verbose --pidfile\
       /var/run/sshd.pid --exec /usr/sbin/sshd ;;

  stop)
     start-stop-daemon --stop --verbose --oknodo\
       --pidfile /var/run/sshd.pid --exec \
       /usr/sbin/sshd ;;

  reload)
     start-stop-daemon --stop --signal 1 --quiet\
       --oknodo --pidfile /var/run/sshd.pid --\
       exec /usr/sbin/sshd ;;
  *)
  echo "gUsage: /etc/init.d/ssh \
       {start|stop|reload}"
  exit 1
esac
exit 0