diff options
author | Dave Woodfall <dave@tty1.uk> | 2018-12-12 02:31:27 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-12-15 20:44:23 +0700 |
commit | 67ad7cc10ceb87d5af1a66ea85e3092853fab4b5 (patch) | |
tree | 9946c533f9598cc6060436e0cb0a78615e07f7cf /network/milter-greylist | |
parent | 9e6d0156d4a68db1b535ee4dee67b0516d5e233d (diff) | |
download | slackbuilds-67ad7cc10ceb87d5af1a66ea85e3092853fab4b5.tar.gz |
network/milter-greylist: Add rc init script. Move .conf to .example.
Diffstat (limited to 'network/milter-greylist')
-rw-r--r-- | network/milter-greylist/doinst.sh | 13 | ||||
-rw-r--r-- | network/milter-greylist/milter-greylist.SlackBuild | 11 | ||||
-rw-r--r-- | network/milter-greylist/milter-greylist.info | 4 | ||||
-rw-r--r-- | network/milter-greylist/rc.milter-greylist.new | 83 |
4 files changed, 101 insertions, 10 deletions
diff --git a/network/milter-greylist/doinst.sh b/network/milter-greylist/doinst.sh index 0d5a67743a..90e65a9c0f 100644 --- a/network/milter-greylist/doinst.sh +++ b/network/milter-greylist/doinst.sh @@ -11,4 +11,15 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -config etc/mail/greylist.conf.new +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.milter-greylist.new diff --git a/network/milter-greylist/milter-greylist.SlackBuild b/network/milter-greylist/milter-greylist.SlackBuild index 39b27f5c13..a440fe5877 100644 --- a/network/milter-greylist/milter-greylist.SlackBuild +++ b/network/milter-greylist/milter-greylist.SlackBuild @@ -23,7 +23,7 @@ PRGNAM=milter-greylist VERSION=${VERSION:-4.6.2} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -89,16 +89,13 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -find $PKG -name perllocal.pod \ - -o -name ".packlist" \ - -o -name "*.bs" \ - | xargs rm -f - mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a ChangeLog README $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -mv $PKG/etc/mail/greylist.conf $PKG/etc/mail/greylist.conf.new +mkdir -p $PKG/etc/rc.d/ +mv $PKG/etc/mail/greylist.conf $PKG/etc/mail/greylist.conf.example +cat $CWD/rc.milter-greylist.new > $PKG/etc/rc.d/rc.milter-greylist.new mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/network/milter-greylist/milter-greylist.info b/network/milter-greylist/milter-greylist.info index a54c94d884..825943d46d 100644 --- a/network/milter-greylist/milter-greylist.info +++ b/network/milter-greylist/milter-greylist.info @@ -6,5 +6,5 @@ MD5SUM="8872008db2fc6b93dd9ab8576383fec2" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="David Woodfall" -EMAIL="dave@dawoodfall.net" +MAINTAINER="Dave Woodfall" +EMAIL="dave@tty1.uk" diff --git a/network/milter-greylist/rc.milter-greylist.new b/network/milter-greylist/rc.milter-greylist.new new file mode 100644 index 0000000000..5f4ce88cb4 --- /dev/null +++ b/network/milter-greylist/rc.milter-greylist.new @@ -0,0 +1,83 @@ +#!/bin/sh +# +# Slackware init script for milter-greylist + +# Copyright 2018 Dave Woodfall <dave@tty1.uk> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +BIN="milter-greylist" +SOCK="/var/milter-greylist/milter-greylist.sock" + +start() { + if [ -e "$SOCK" ]; then + PID=$(pgrep -x $BIN) + if [ -n "$PID" ]; then + printf "%s\n" "$BIN is already running with pid $PID" + exit 1 + else + printf "%s\n" "Removing stale socket..." + rm -vf "$SOCK" + fi + fi + printf "%s\n" "Starting $BIN" + $BIN + sleep 2 + PID=$(pgrep -x $BIN) + if [ -n "$PID" ]; then + printf "%s\n" "$BIN is running with pid $PID" + fi +} + +stop() { + printf "%s\n" "Stopping $BIN" + pkill -x $BIN + sleep 2 + printf "%s\n" "Removing socket..." + rm -vf "$SOCK" +} + +status() { + PID=$(pgrep -x $BIN) + if [ -n "$PID" ]; then + printf "%s\n" "$BIN is running with pid $PID" + else + printf "%s\n" "$BIN is not running" + fi +} +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 3 # allow some time to dump the db + start + ;; + status) + status + ;; + *) + echo Usage: $0 "{start|stop|restart|status}" + exit 1 + ;; +esac |