head	1.4;
access;
symbols
	4-7-4:1.3
	4-7-3:1.3
	4-7-2:1.3
	4-7-1:1.3
	4-7-0:1.3
	4-6-9:1.3
	4-6-8:1.3
	4-6-7:1.3
	4-6-6:1.3
	4-6-5:1.3
	4-6-4:1.3
	4-6-3:1.3;
locks; strict;
comment	@# @;


1.4
date	99.01.05.04.46.48;	author esr;	state Exp;
branches;
next	1.3;

1.3
date	98.10.19.02.58.36;	author esr;	state Exp;
branches;
next	1.2;

1.2
date	98.10.17.22.39.13;	author esr;	state Exp;
branches;
next	1.1;

1.1
date	98.10.17.22.37.24;	author esr;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Progress messages now go to stdout.
@
text
@#!/bin/sh
#
# fetchmail	This shell script takes care of starting and stopping
#		fetchmail.
#
# chkconfig: 2345 55 45
# description: The Fetchmail daemons allows to retrieve mail using various
#	       mail protocols and route them to the local MTA just as if
#	       the mail was sent directly to the local MTA. This is
#	       specially useful on intermittent dial-up connections.
# processname: fetchmail
# config: /etc/fetchmailrc
# author[s]:
#	Andrea Sterbini	<a.sterbini@@itelcad.it>
#	ObiTuarY <obituary@@freshmeat.net>

. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi 
    
# See how we were called.
case "$1" in
  start)
	if [ -s /etc/fetchmailrc ]; then
		echo -n "Loading fetchmail: "
		daemon /usr/bin/fetchmail -f /etc/fetchmailrc
		echo
		touch /var/lock/subsys/fetchmail
	else
		exit 1
	fi
	;;
  stop)	
	echo -n "Shutting down fetchmail: "
	/usr/bin/fetchmail -q >/dev/null 2>&1 && echo fetchmail
#	killproc fetchmail
	rm -f /var/lock/subsys/fetchmail
	;;
  status)
        status fetchmail
        ;;
  restart|reload)
        $0 stop
        $0 start
        ;; 
	*)
	echo "Usage: fetchmail {start|stop|status|restart|reload}"
	exit 1
esac

exit 0

# === End of File ===
@


1.3
log
@Obituary's second set of mods.
@
text
@d42 1
a42 1
	/usr/bin/fetchmail -q >& /dev/null && echo fetchmail
@


1.2
log
@Obituary enhancement.
@
text
@d3 2
a4 1
# description: The fetchmail daemon checks for mail over ppp
d6 8
a13 1
# Author[s]:
d15 1
a15 11
#
# Addition:
#	If there is no /etc/fetchmailrc or it its size is == 0 don't start
#	fetchmail. This helps for people who don't use fetchmail as a daemon
#	because usually this kind of script is included by default into a
#	a RPM package. Second possible solution on a RedHat >= 5.0 system is
#	not to run chkconfig(8) when the RPM package is installed, that way
#	the sysadmin has to explicitly add fetchmail with chkconfig. Maybe
#	this script should also check if a MTA is running. But I'm not exactly
#	sure of that right now.
#		ObiTuarY <obituary@@freshmeat.net>
d23 4
a26 1
[ ${NETWORKING} = "no" ] && exit 0
d33 1
a33 1
		daemon /usr/bin/fetchmail -d 60 -f /etc/fetchmailrc
d36 2
@


1.1
log
@Initial revision
@
text
@d7 11
d30 6
a35 4
	echo -n "Loading fetchmail: "
	daemon /usr/bin/fetchmail -d 60 -f /etc/fetchmailrc
	echo
	touch /var/lock/subsys/fetchmail
@
