#!/bin/sh # # chkconfig: 345 91 35 # description: Starts and stops the fetchmail daemon used to retrive mail via # various protocols (such as POP3 and IMAP4). # # config: /etc/fetchmailrc export PATH=/bin:/sbin:/usr/bin:/usr/sbin # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Demon specified configuration. . /etc/sysconfig/fetchmail # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 # Check that fetchmailrc exists. [ -f /etc/fetchmailrc ] || exit 0 # See how we were called. case "$1" in start) show Starting fetchmail daemon $NICELEVEL fetchmail -f /etc/fetchmailrc touch /var/lock/subsys/fetchmail ;; stop) show Stopping fetchmail killproc fetchmail rm -f /var/lock/subsys/fetchmail ;; status) status fetchmail ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac