4 # description: Starts and stops the fetchmail daemon used to retrive mail \
5 # via various protocols (such as POP3 and IMAP4).
7 # config: /etc/fetchmailrc
9 # Source function library.
10 . /etc/rc.d/init.d/functions
12 # Source networking configuration.
13 # Get service config - may override defaults
14 [ -f /etc/sysconfig/fetchmail ] && . /etc/sysconfig/fetchmail
16 # Check that networking is up.
17 if is_no "${NETWORKING}"; then
18 # nls "ERROR: Networking is down. %s can't be run." <service>
19 msg_Network_Down <service>
23 # Check that fetchmailrc exists.
24 [ -f /etc/fetchmailrc ] || exit 0
26 # See how we were called.
29 if [ ! -f /var/lock/subsys/fetchmail ]; then
30 # show "Starting %s service." fetchmail
31 msg_starting fetchmail
34 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fetchmail
36 # show "%s service is already running." fetchmail
37 msg_Already_Running fetchmail
42 if [ -f /var/lock/subsys/syslogd ]; then
43 msg_stopping fetchmail
45 rm -f /var/lock/subsys/fetchmail >/dev/null 2>&1
47 # show "%s service is not running." fetchmail
48 msg_Not_Running fetchmail
57 if [ -f /var/lock/subsys/fetchmail ]; then
61 killproc fetchmail -HUP
65 msg_Not_Running fetchmail
70 # if program allows reloading without stopping
83 msg_Usage "$0 {start|stop|status|restart|reload|force-reload}"