X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fmail;h=158562202dbc092b5a19f5e90132640d61d47a1f;hb=e143940d896bf696a949dbf70f7d96327acf5f62;hp=fe31b25016d54eb0221c837afb28a3120f94a898;hpb=2f0a78d07d92ba2f397a852de6bcc9db8817bfb9;p=myplc.git diff --git a/plc.d/mail b/plc.d/mail index fe31b25..1585622 100755 --- a/plc.d/mail +++ b/plc.d/mail @@ -1,14 +1,12 @@ #!/bin/bash # -# priority: 250 +# priority: 200 # # Start local mail server. # # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: mail,v 1.3 2006/06/23 20:29:22 mlhuang Exp $ -# # Source function library and configuration . /etc/plc.d/functions @@ -28,9 +26,12 @@ case "$1" in # Add apache to list of users that can send mail as others # without a warning, so that the API can send out mail. - echo "apache" >/etc/mail/trusted-users + count=$(grep ^apache /etc/mail/trusted-users|wc -l) + if [ $count -eq 0 ] ; then + echo "apache" >>/etc/mail/trusted-users + fi - service sendmail start + (exec 3>&- 4>&- ; service sendmail start) check result "$MESSAGE"