X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=fetchmail.init;fp=fetchmail.init;h=25d4cf3820b10bb2f818e4348565d29f4fe4147e;hb=3681cedeaa6bdab249d229024c3331356bbf9099;hp=0000000000000000000000000000000000000000;hpb=21b6ca3c0085aa7c56e7e6fd0b6038a79771132b;p=packages%2Ffetchmail.git diff --git a/fetchmail.init b/fetchmail.init new file mode 100644 index 0000000..25d4cf3 --- /dev/null +++ b/fetchmail.init @@ -0,0 +1,49 @@ +#!/bin/sh +# +# chkconfig: 345 91 35 +# description: Starts and stops the fetchmail daemon used to retrive mail via +# various protocols (such as POP3 and IMAP4). +# +# config: /etc/fetchmailrc + +export PATH=/bin:/sbin:/usr/bin:/usr/sbin + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Demon specified configuration. +. /etc/sysconfig/fetchmail + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 0 + +# Check that fetchmailrc exists. +[ -f /etc/fetchmailrc ] || exit 0 + +# See how we were called. +case "$1" in + start) + show Starting fetchmail + daemon $NICELEVEL fetchmail -f /etc/fetchmailrc + touch /var/lock/subsys/fetchmail + ;; + stop) + show Stopping fetchmail + killproc fetchmail + rm -f /var/lock/subsys/fetchmail + ;; + status) + status fetchmail + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 +esac +