#!/bin/bash # # qpopper This shell script takes care of starting and stopping qpopper # It is rather basic and could do with some improvements # # chkconfig: 2345 80 30 # description: Qpopper is a POP3 server. # processname: qpopper # Source function library. . /etc/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # Check that the binary exists [ -f /usr/sbin/qpopper ] || exit 0 start() { # Start daemons. echo -n $"Starting Qpopper: " daemon /usr/sbin/qpopper -f /etc/qpopper.conf RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/qpopper } stop() { # Stop daemons. echo -n $"Shutting down Qpopper: " killproc qpopper RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/qpopper } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; *) echo $"Usage: qpopper {start|stop|restart}" exit 1 esac exit $RETVAL