- start and stop local sendmail daemon
[myplc.git] / plc.d / mail
1 #!/bin/bash
2 #
3 # priority: 250
4 #
5 # Start local mail server.
6 #
7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
9 #
10 # $Id: httpd,v 1.1 2006/04/06 21:51:59 mlhuang Exp $
11 #
12
13 # Source function library and configuration
14 . /etc/plc.d/functions
15
16 case "$1" in
17     start)
18         if [ "$PLC_MAIL_ENABLED" != "1" ] ; then
19             exit 0
20         fi
21
22         MESSAGE=$"Starting mail server"
23         dialog "$MESSAGE"
24
25         service sendmail start
26         check
27
28         result "$MESSAGE"
29         ;;
30
31     stop)
32         MESSAGE=$"Stopping mail server"
33         dialog "$MESSAGE"
34
35         service sendmail stop
36         check
37
38         result "$MESSAGE"
39         ;;
40 esac
41
42 exit $ERRORS