git://git.onelab.eu
/
myplc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Setting tag myplc-5.3-5
[myplc.git]
/
plc.d
/
mail
diff --git
a/plc.d/mail
b/plc.d/mail
index
6698a68
..
2471d65
100755
(executable)
--- a/
plc.d/mail
+++ b/
plc.d/mail
@@
-1,43
+1,53
@@
#!/bin/bash
#
#!/bin/bash
#
-# priority: 2
5
0
+# priority: 2
0
0
#
# Start local mail server.
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
#
# Start local mail server.
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: mail,v 1.1 2006/04/24 15:49:32 mlhuang Exp $
-#
# Source function library and configuration
# Source function library and configuration
-. /etc/plc.d/functions
-. /etc/planetlab/plc_config
+source /etc/plc.d/functions
+source /etc/planetlab/plc_config
+
+# Be verbose
+set -x
+
+echo '$1' = $1
case "$1" in
start)
case "$1" in
start)
- if [ "$PLC_MAIL_ENABLED" != "1" ] ; then
- exit 0
- fi
+ if [ "$PLC_MAIL_ENABLED" != "1" ] ; then
+ exit 0
+ fi
+
+ MESSAGE=$"Starting mail server"
+ dialog "$MESSAGE"
- MESSAGE=$"Starting mail server"
- dialog "$MESSAGE"
+ # Add apache to list of users that can send mail as others
+ # without a warning, so that the API can send out mail.
+ count=$(grep ^apache /etc/mail/trusted-users|wc -l)
+ if [ $count -eq 0 ] ; then
+ echo "apache" >>/etc/mail/trusted-users
+ fi
- service sendmail start
- check
+ (exec 3>&- 4>&- ; systemctl start sendmail)
+
check
- result "$MESSAGE"
- ;;
+
result "$MESSAGE"
+
;;
stop)
stop)
- MESSAGE=$"Stopping mail server"
- dialog "$MESSAGE"
+
MESSAGE=$"Stopping mail server"
+
dialog "$MESSAGE"
- service sendmail stop
- check
+ systemctl stop sendmail
+
check
- result "$MESSAGE"
- ;;
+
result "$MESSAGE"
+
;;
esac
exit $ERRORS
esac
exit $ERRORS