]> Pileus Git - ~andy/fetchmail/blob - contrib/redhat_rc
Minor bug fixes for socket.c
[~andy/fetchmail] / contrib / redhat_rc
1 #!/bin/sh
2 #
3 # fetchmail     This shell script takes care of starting and stopping
4 #               fetchmail.
5 #
6 # chkconfig: 2345 81 45
7 # description: The Fetchmail daemons allows to retrieve mail using various
8 #              mail protocols and route them to the local MTA just as if
9 #              the mail was sent directly to the local MTA. This is
10 #              specially useful on intermittent dial-up connections.
11 # processname: fetchmail
12 # config: /etc/fetchmailrc
13 # author[s]:
14 #       Andrea Sterbini <a.sterbini@itelcad.it>
15 #       ObiTuarY <obituary@freshmeat.net>
16
17 . /etc/rc.d/init.d/functions
18
19 # Source networking configuration.
20 . /etc/sysconfig/network
21
22 # Check that networking is up.
23 if [ ${NETWORKING} = "no" ]
24 then
25         exit 0
26 fi 
27     
28 # See how we were called.
29 case "$1" in
30   start)
31         if [ -s /etc/fetchmailrc ]; then
32                 echo -n "Loading fetchmail: "
33                 daemon /usr/bin/fetchmail -f /etc/fetchmailrc
34                 echo
35                 touch /var/lock/subsys/fetchmail
36         else
37                 exit 1
38         fi
39         ;;
40   stop) 
41         echo -n "Shutting down fetchmail: "
42         /usr/bin/fetchmail -q >/dev/null 2>&1 && echo fetchmail
43 #       killproc fetchmail
44         rm -f /var/lock/subsys/fetchmail
45         ;;
46   status)
47         status fetchmail
48         ;;
49   restart|reload)
50         $0 stop
51         $0 start
52         ;; 
53         *)
54         echo "Usage: fetchmail {start|stop|status|restart|reload}"
55         exit 1
56 esac
57
58 exit 0
59
60 # === End of File ===