From 4b5b46c292b648b64348ca5ddb846055b5fae5bf Mon Sep 17 00:00:00 2001 From: Juergen Daubert Date: Thu, 5 Mar 2015 11:10:30 +0100 Subject: [PATCH] masqmail: new rc script --- masqmail/.md5sum | 2 +- masqmail/Pkgfile | 2 +- masqmail/masqmail | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/masqmail/.md5sum b/masqmail/.md5sum index 98f48a603..efd767c67 100644 --- a/masqmail/.md5sum +++ b/masqmail/.md5sum @@ -1,2 +1,2 @@ -413f66f053693a10abc4c9c632fd0659 masqmail +af808bb35a4d7ed37dc895d5a13201b9 masqmail 67bc223b0ae2e990a4255265f62cc1e4 masqmail-0.3.5.tar.gz diff --git a/masqmail/Pkgfile b/masqmail/Pkgfile index bb116d1fc..d9d3bf15a 100644 --- a/masqmail/Pkgfile +++ b/masqmail/Pkgfile @@ -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) diff --git a/masqmail/masqmail b/masqmail/masqmail index e3764bd2a..af5262eac 100644 --- a/masqmail/masqmail +++ b/masqmail/masqmail @@ -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