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
10 # Source function library.
11 . /etc/rc.d/init.d/functions
13 # Source networking configuration.
14 # Get service config - may override defaults
15 [ -f /etc/sysconfig/fetchmail ] && . /etc/sysconfig/fetchmail
18 [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
20 # Check that networking is up.
21 if is_no "${NETWORKING}"; then
22 msg_Network_Down "fetchmail"
26 # Check that fetchmailrc exists.
27 [ -f /etc/fetchmailrc ] || exit 0
29 # See how we were called.
32 if [ ! -f /var/lock/subsys/fetchmail ]; then
33 msg_starting "fetchmail"
34 daemon fetchmail -f /etc/fetchmailrc
36 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fetchmail
38 msg_Already_Running fetchmail
43 if [ -f /var/lock/subsys/fetchmail ]; then
44 msg_stopping "fetchmail"
46 rm -f /var/lock/subsys/fetchmail >/dev/null 2>&1
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}"