- start and stop local sendmail daemon
authorMark Huang <mlhuang@cs.princeton.edu>
Mon, 24 Apr 2006 15:49:32 +0000 (15:49 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Mon, 24 Apr 2006 15:49:32 +0000 (15:49 +0000)
plc.d/mail [new file with mode: 0755]

diff --git a/plc.d/mail b/plc.d/mail
new file mode 100755 (executable)
index 0000000..129bb3d
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# priority: 250
+#
+# Start local mail server.
+#
+# Mark Huang <mlhuang@cs.princeton.edu>
+# Copyright (C) 2006 The Trustees of Princeton University
+#
+# $Id: httpd,v 1.1 2006/04/06 21:51:59 mlhuang Exp $
+#
+
+# Source function library and configuration
+. /etc/plc.d/functions
+
+case "$1" in
+    start)
+       if [ "$PLC_MAIL_ENABLED" != "1" ] ; then
+           exit 0
+       fi
+
+       MESSAGE=$"Starting mail server"
+       dialog "$MESSAGE"
+
+       service sendmail start
+       check
+
+       result "$MESSAGE"
+       ;;
+
+    stop)
+       MESSAGE=$"Stopping mail server"
+       dialog "$MESSAGE"
+
+       service sendmail stop
+       check
+
+       result "$MESSAGE"
+       ;;
+esac
+
+exit $ERRORS