view suse/masqmail @ 0:08114f7dcc23 0.2.21

this is masqmail-0.2.21 from oliver kurth
author meillo@marmaro.de
date Fri, 26 Sep 2008 17:05:23 +0200
parents
children
line wrap: on
line source

#! /bin/sh
# Author: Oliver Kurth <okurth@uni-sw.gwdg.de>
#
# /sbin/init.d/masqmail
#

. /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && SMTP=yes
test "$SMTP" = yes || exit 0

if test -z "$MASQMAIL_ARGS" ; then
	MASQMAIL_ARGS="-bd -q30m"
fi

# The echo return value for success (defined in /etc/rc.config).
return=$rc_done
case "$1" in
    start)
	echo -n "Starting SMTP (MasqMail)"
	## Start daemon with startproc(8). If this fails
	## the echo return value is set appropriate.

	startproc /usr/sbin/sendmail $MASQMAIL_ARGS || return=$rc_failed

	echo -e "$return"
	;;
    stop)
	echo -n "Shutting down SMTP (MasqMail)"
	## Stop daemon with killproc(8) and if this fails
	## set echo the echo return value.

	killproc -TERM /usr/sbin/sendmail || return=$rc_failed

	echo -e "$return"
	;;
    restart)
	## If first returns OK call the second, if first or
	## second command fails, set echo return value.
	$0 stop  &&  $0 start  ||  return=$rc_failed
	;;
    reload)
	## Choose ONE of the following two cases:

	## First possibility: A few services accepts a signal
	## to reread the (changed) configuration.

	#echo -n "Reload service MasqMail"
	#killproc -HUP /usr/sbin/sendmail || return=$rc_failed
	#echo -e "$return"

	## Exclusive possibility: Some services must be stopped
	## and started to force a new load of the configuration.

	$0 stop  &&  $0 start  ||  return=$rc_failed
	;;
    status)
	echo -n "Checking for service SMTP (MasqMail): "
	## Check status with checkproc(8), if process is running
	## checkproc will return with exit status 0.

	checkproc /usr/sbin/sendmail && echo OK || echo No process
	;;
#    probe)
	## Optional: Probe for the necessity of a reload,
	## give out the argument which is required for a reload.

#	test /usr/exim/configure -nt /var/lock/exim.pid && echo reload
#	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|reload|probe}"
	exit 1
	;;
esac

# Inform the caller not only verbosely and set an exit status.
test "$return" = "$rc_done" || exit 1
exit 0