masqmail-0.2

diff suse/masqmail @ 0:08114f7dcc23

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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/suse/masqmail	Fri Sep 26 17:05:23 2008 +0200
     1.3 @@ -0,0 +1,83 @@
     1.4 +#! /bin/sh
     1.5 +# Author: Oliver Kurth <okurth@uni-sw.gwdg.de>
     1.6 +#
     1.7 +# /sbin/init.d/masqmail
     1.8 +#
     1.9 +
    1.10 +. /etc/rc.config
    1.11 +
    1.12 +# Determine the base and follow a runlevel link name.
    1.13 +base=${0##*/}
    1.14 +link=${base#*[SK][0-9][0-9]}
    1.15 +
    1.16 +# Force execution if not called by a runlevel directory.
    1.17 +test $link = $base && SMTP=yes
    1.18 +test "$SMTP" = yes || exit 0
    1.19 +
    1.20 +if test -z "$MASQMAIL_ARGS" ; then
    1.21 +	MASQMAIL_ARGS="-bd -q30m"
    1.22 +fi
    1.23 +
    1.24 +# The echo return value for success (defined in /etc/rc.config).
    1.25 +return=$rc_done
    1.26 +case "$1" in
    1.27 +    start)
    1.28 +	echo -n "Starting SMTP (MasqMail)"
    1.29 +	## Start daemon with startproc(8). If this fails
    1.30 +	## the echo return value is set appropriate.
    1.31 +
    1.32 +	startproc /usr/sbin/sendmail $MASQMAIL_ARGS || return=$rc_failed
    1.33 +
    1.34 +	echo -e "$return"
    1.35 +	;;
    1.36 +    stop)
    1.37 +	echo -n "Shutting down SMTP (MasqMail)"
    1.38 +	## Stop daemon with killproc(8) and if this fails
    1.39 +	## set echo the echo return value.
    1.40 +
    1.41 +	killproc -TERM /usr/sbin/sendmail || return=$rc_failed
    1.42 +
    1.43 +	echo -e "$return"
    1.44 +	;;
    1.45 +    restart)
    1.46 +	## If first returns OK call the second, if first or
    1.47 +	## second command fails, set echo return value.
    1.48 +	$0 stop  &&  $0 start  ||  return=$rc_failed
    1.49 +	;;
    1.50 +    reload)
    1.51 +	## Choose ONE of the following two cases:
    1.52 +
    1.53 +	## First possibility: A few services accepts a signal
    1.54 +	## to reread the (changed) configuration.
    1.55 +
    1.56 +	#echo -n "Reload service MasqMail"
    1.57 +	#killproc -HUP /usr/sbin/sendmail || return=$rc_failed
    1.58 +	#echo -e "$return"
    1.59 +
    1.60 +	## Exclusive possibility: Some services must be stopped
    1.61 +	## and started to force a new load of the configuration.
    1.62 +
    1.63 +	$0 stop  &&  $0 start  ||  return=$rc_failed
    1.64 +	;;
    1.65 +    status)
    1.66 +	echo -n "Checking for service SMTP (MasqMail): "
    1.67 +	## Check status with checkproc(8), if process is running
    1.68 +	## checkproc will return with exit status 0.
    1.69 +
    1.70 +	checkproc /usr/sbin/sendmail && echo OK || echo No process
    1.71 +	;;
    1.72 +#    probe)
    1.73 +	## Optional: Probe for the necessity of a reload,
    1.74 +	## give out the argument which is required for a reload.
    1.75 +
    1.76 +#	test /usr/exim/configure -nt /var/lock/exim.pid && echo reload
    1.77 +#	;;
    1.78 +    *)
    1.79 +	echo "Usage: $0 {start|stop|status|restart|reload|probe}"
    1.80 +	exit 1
    1.81 +	;;
    1.82 +esac
    1.83 +
    1.84 +# Inform the caller not only verbosely and set an exit status.
    1.85 +test "$return" = "$rc_done" || exit 1
    1.86 +exit 0