#!/bin/sh . /etc/rc.d/init.d/functions #[ -f /usr/sbin/fetchmail ] || exit 0 prog="fetchmail" start() { echo -n $"Starting $prog: " daemon fetchmail -f /etc/fetchmailrc -d 1800 RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fetchmail echo return $RETVAL } stop() { if test "x`pidof fetchmail`" != x; then echo -n $"Stopping $prog: " killproc fetchmail echo fi RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/fetchmail return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status fetchmail ;; restart) stop start ;; condrestart) if test "x`pidof fetchmail`" != x; then stop start fi ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit 0