masqmail: new rc script

This commit is contained in:
Juergen Daubert 2015-03-05 11:10:30 +01:00
parent 960b4ed6d8
commit 4b5b46c292
3 changed files with 19 additions and 6 deletions

View File

@ -1,2 +1,2 @@
413f66f053693a10abc4c9c632fd0659 masqmail
af808bb35a4d7ed37dc895d5a13201b9 masqmail
67bc223b0ae2e990a4255265f62cc1e4 masqmail-0.3.5.tar.gz

View File

@ -5,7 +5,7 @@
name=masqmail
version=0.3.5
release=1
release=2
source=(http://marmaro.de/prog/masqmail/files/$name-$version.tar.gz
masqmail)

View File

@ -3,20 +3,33 @@
# /etc/rc.d/masqmail: start/stop masqmail SMTP daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/masqmail
PID=/var/run/masqmail.pid
OPTS="-bd -q15m"
case $1 in
start)
/usr/sbin/masqmail -bd -q20m
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
;;
stop)
killall -q /usr/sbin/masqmail
$SSD --stop --retry 10 --pidfile $PID
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
$SSD --status --pidfile $PID
case $? in
0) echo "$PROG is running" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart]"
echo "usage: $0 [start|stop|restart|status]"
;;
esac