#! /bin/sh # Copyright (c) 1999 NORDWERK.DE, Germany. All rights reserved. # # Author: Michael Diekmann # # /etc/init.d/proftpd # DBROOT=/dev/null . /etc/rc.config # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_PROFTPD="yes" test "$START_PROFTPD" = yes || exit 0 # The echo return value for success (defined in /etc/rc.config). return=$rc_done case "$1" in start) if test -x /usr/local/proftpd/current/sbin/proftpd ; then echo -n "Starting ProFTPd..." startproc /usr/local/proftpd/current/sbin/proftpd -c /etc/proftpd/proftpd.conf || return=$rc_failed echo -e "$return" fi ;; stop) echo -n "Shutting down ProFTPd..." killproc -TERM /usr/local/proftpd/current/sbin/proftpd || return=$rc_failed echo -e "$return" ;; restart) echo -n "Restarting ProFTPd..." killproc -HUP /usr/local/proftpd/current/sbin/proftpd || return=$rc_failed echo -e "$return" ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac # Inform the caller not only verbosely and set an exit status. test "$return" = "$rc_done" || exit 1 exit 0