updated on Thu Jan 26 12:02:26 UTC 2012
[aur-mirror.git] / sendmail / sendmail.rc
blob71b80649f3abdac9fa25c8a3b8879bff69b680a8
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 [[ ${SENDMAIL_OPTS+set} ]] || SENDMAIL_OPTS="-bd -q30m -L sm-mta"
7 [[ ${CLIENTMCLIENTMQUEUE_OPTS+set} ]] || CLIENTMQUEUE_OPTS="-Ac -q30m -L sm-cm"
9 case "$1" in
10 start)
11 stat_busy "Starting sendmail"
13 /usr/bin/newaliases > /dev/null 2>&1
14 (cd /var/spool/mqueue && rm -f xf*)
15 /usr/sbin/sendmail ${SENDMAIL_OPTS} > /dev/null 2>&1 \
16 && /usr/sbin/sendmail ${CLIENTMQUEUE_OPTS} > /dev/null 2>&1
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 add_daemon sendmail
21 stat_done
25 stop)
26 stat_busy "Stopping sendmail"
28 kill $(head -n 1 /var/run/sendmail.pid) \
29 $(head -n 1 /var/spool/clientmqueue/sm-client.pid)
31 if [ $? -gt 0 ]; then
32 stat_fail
33 else
34 rm_daemon sendmail
35 stat_done
38 restart)
39 $0 stop
40 sleep 3
41 $0 start
44 echo "usage: $0 {start|stop|restart}"
45 esac
46 exit 0