#!/bin/sh name="exim" exim_flags=${exim_flags-"-bd -q30m"} rcvar=$name command="@PREFIX@/sbin/${name}" pidfile="/var/run/${name}.pid" ENVFILE="@PREFIX@/etc/exim/${name}-env.sh" PLIST="/Library/LaunchDaemons/org.exim.exim.plist" CAT="/bin/cat" KILL="/bin/kill" PS="/bin/ps" GREP="/usr/bin/grep" RM="/bin/rm" # Read customizable environment if it exists test -r "$ENVFILE" && . "$ENVFILE" case "$1" in start) echo "starting exim mail transfer agent" ## $command $exim_flags # /bin/launchctl start org.exim.exim /bin/launchctl load -w $PLIST ;; reload) echo "restarting exim mail transfer agent" [ -f $pidfile ] && $KILL -HUP `$CAT $pidfile` ;; restart) echo "restarting exim mail transfer agent" ## [ -f $pidfile ] && $KILL -15 `$CAT $pidfile` # /bin/launchctl stop org.exim.exim ## $command $exim_flags # /bin/launchctl start org.exim.exim /bin/launchctl unload $PLIST /bin/launchctl load -w $PLIST ;; stop) echo "stopping exim mail transfer agent" ## [ -f $pidfile ] && $KILL -15 `$CAT $pidfile` # /bin/launchctl stop org.exim.exim /bin/launchctl unload $PLIST if [ ! -z "$pidfile" ] && [ -f $pidfile ] ; then PID=`$CAT $pidfile` [ -z "`$PS -A | $GREP \"^ *$PID \" | $GREP $name | $GREP -v grep`" ] && $RM $pidfile fi ;; *) echo "Usage: /etc/rc.d/$NAME {start|stop|restart|reload}" exit 1 ;; esac