- don't source shell configuration in /etc/plc.d/functions, which is
[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: mail,v 1.1 2006/04/24 15:49:32 mlhuang Exp $
11 #
12
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
16
17 case "$1" in
18     start)
19         if [ "$PLC_MAIL_ENABLED" != "1" ] ; then
20             exit 0
21         fi
22
23         MESSAGE=$"Starting mail server"
24         dialog "$MESSAGE"
25
26         service sendmail start
27         check
28
29         result "$MESSAGE"
30         ;;
31
32     stop)
33         MESSAGE=$"Stopping mail server"
34         dialog "$MESSAGE"
35
36         service sendmail stop
37         check
38
39         result "$MESSAGE"
40         ;;
41 esac
42
43 exit $ERRORS