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 [ -z "$POLL_INTERVAL" ] && POLL_INTERVAL=300
21 [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
23 # Check that networking is up.
24 if is_no "${NETWORKING}"; then
25 msg_Network_Down "fetchmail"
29 # Check that fetchmailrc exists.
30 [ -f /etc/fetchmailrc ] || exit 0
32 # See how we were called.
35 if [ ! -f /var/lock/subsys/fetchmail ]; then
36 msg_starting "fetchmail"
37 daemon fetchmail -d "$POLL_INTERVAL" -f /etc/fetchmailrc
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fetchmail
41 msg_Already_Running fetchmail
46 if [ -f /var/lock/subsys/fetchmail ]; then
47 msg_stopping "fetchmail"
49 rm -f /var/lock/subsys/fetchmail >/dev/null 2>&1
51 msg_Not_Running "fetchmail"
60 if [ -f /var/lock/subsys/fetchmail ]; then
61 msg_reloading "fetchmail"
63 killproc fetchmail -HUP
67 msg_Not_Running fetchmail
72 # if program allows reloading without stopping
85 msg_Usage "$0 {start|stop|status|restart|reload|force-reload}"