masqmail-0.2

view 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 source
1 #! /bin/sh
2 # Author: Oliver Kurth <okurth@uni-sw.gwdg.de>
3 #
4 # /sbin/init.d/masqmail
5 #
7 . /etc/rc.config
9 # Determine the base and follow a runlevel link name.
10 base=${0##*/}
11 link=${base#*[SK][0-9][0-9]}
13 # Force execution if not called by a runlevel directory.
14 test $link = $base && SMTP=yes
15 test "$SMTP" = yes || exit 0
17 if test -z "$MASQMAIL_ARGS" ; then
18 MASQMAIL_ARGS="-bd -q30m"
19 fi
21 # The echo return value for success (defined in /etc/rc.config).
22 return=$rc_done
23 case "$1" in
24 start)
25 echo -n "Starting SMTP (MasqMail)"
26 ## Start daemon with startproc(8). If this fails
27 ## the echo return value is set appropriate.
29 startproc /usr/sbin/sendmail $MASQMAIL_ARGS || return=$rc_failed
31 echo -e "$return"
32 ;;
33 stop)
34 echo -n "Shutting down SMTP (MasqMail)"
35 ## Stop daemon with killproc(8) and if this fails
36 ## set echo the echo return value.
38 killproc -TERM /usr/sbin/sendmail || return=$rc_failed
40 echo -e "$return"
41 ;;
42 restart)
43 ## If first returns OK call the second, if first or
44 ## second command fails, set echo return value.
45 $0 stop && $0 start || return=$rc_failed
46 ;;
47 reload)
48 ## Choose ONE of the following two cases:
50 ## First possibility: A few services accepts a signal
51 ## to reread the (changed) configuration.
53 #echo -n "Reload service MasqMail"
54 #killproc -HUP /usr/sbin/sendmail || return=$rc_failed
55 #echo -e "$return"
57 ## Exclusive possibility: Some services must be stopped
58 ## and started to force a new load of the configuration.
60 $0 stop && $0 start || return=$rc_failed
61 ;;
62 status)
63 echo -n "Checking for service SMTP (MasqMail): "
64 ## Check status with checkproc(8), if process is running
65 ## checkproc will return with exit status 0.
67 checkproc /usr/sbin/sendmail && echo OK || echo No process
68 ;;
69 # probe)
70 ## Optional: Probe for the necessity of a reload,
71 ## give out the argument which is required for a reload.
73 # test /usr/exim/configure -nt /var/lock/exim.pid && echo reload
74 # ;;
75 *)
76 echo "Usage: $0 {start|stop|status|restart|reload|probe}"
77 exit 1
78 ;;
79 esac
81 # Inform the caller not only verbosely and set an exit status.
82 test "$return" = "$rc_done" || exit 1
83 exit 0