]> git.pld-linux.org Git - packages/fetchmail.git/blobdiff - fetchmail.init
- PLD-style init script.
[packages/fetchmail.git] / fetchmail.init
diff --git a/fetchmail.init b/fetchmail.init
new file mode 100644 (file)
index 0000000..25d4cf3
--- /dev/null
@@ -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
+
This page took 0.514564 seconds and 4 git commands to generate.