]> git.pld-linux.org Git - packages/fetchmail.git/blame - fetchmail.init
- PLD-style init script.
[packages/fetchmail.git] / fetchmail.init
CommitLineData
3681cede 1#!/bin/sh
2#
3# chkconfig: 345 91 35
4# description: Starts and stops the fetchmail daemon used to retrive mail via
5# various protocols (such as POP3 and IMAP4).
6#
7# config: /etc/fetchmailrc
8
9export PATH=/bin:/sbin:/usr/bin:/usr/sbin
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Source networking configuration.
15. /etc/sysconfig/network
16
17# Demon specified configuration.
18. /etc/sysconfig/fetchmail
19
20# Check that networking is up.
21[ "${NETWORKING}" = "no" ] && exit 0
22
23# Check that fetchmailrc exists.
24[ -f /etc/fetchmailrc ] || exit 0
25
26# See how we were called.
27case "$1" in
28 start)
29 show Starting fetchmail
30 daemon $NICELEVEL fetchmail -f /etc/fetchmailrc
31 touch /var/lock/subsys/fetchmail
32 ;;
33 stop)
34 show Stopping fetchmail
35 killproc fetchmail
36 rm -f /var/lock/subsys/fetchmail
37 ;;
38 status)
39 status fetchmail
40 ;;
41 restart)
42 $0 stop
43 $0 start
44 ;;
45 *)
46 echo "Usage: $0 {start|stop|restart|status}"
47 exit 1
48esac
49
This page took 0.079983 seconds and 4 git commands to generate.