JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr#! /bin/sh # Greylist init script # July 2004 # BERTRAND Joël # ### BEGIN INIT INFO # Provides: milter-greylist # Required-Start: $local_fs $named $remote_fs $syslog # Required-Stop: $local_fs $remote_fs # Should-Start: sendmail # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Script to start/stop the greylist-milter # Description: another spam-defense service ### END INIT INFO . /lib/lsb/init-functions # Based on skeleton by Miquel van Smoorenburg and Ian Murdock PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin DAEMON=/usr/sbin/milter-greylist NAME=greylist SNAME=greylist DESC="Greylist Mail Filter Daemon" PIDFILE="/var/run/$NAME.pid" PNAME="milter-greylist" USER="greylist" SOCKET=/var/run/milter-greylist/milter-greylist.sock [ -x $DAEMON ] || DAEMON=/usr/bin/milter-greylist [ -x $DAEMON ] || exit 0 export TMPDIR=/tmp # Apparently people have trouble if this isn't explicitly set... ENABLED=0 OPTIONS="" NICE= test -f /etc/default/milter-greylist && . /etc/default/milter-greylist DOPTIONS="-P $PIDFILE -u $USER -p $SOCKET" if [ "$ENABLED" = "0" ]; then echo "$DESC: disabled, see /etc/default/milter-greylist" exit 0 fi if ! getent passwd | grep -q "^greylist:"; then echo "$0: greylist user does not exist. Aborting" >&2 exit 1 fi if ! getent group | grep -q "^greylist:" ; then echo "$0: greylist group does not exist. Aborting" >&2 exit 1 fi if [ ! -d /var/run/$PNAME ]; then mkdir /var/run/$PNAME chown greylist:greylist /var/run/$PNAME chmod 755 /var/run/$PNAME fi set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \ $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME --oknodo echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME \ --retry 5 --oknodo start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \ $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS echo "$NAME." ;; reload) echo -n "Checking config: " if su -c "$DAEMON -c" $USER 2>&1 |grep -v 'config .* okay$' |grep . >&2 then echo "failed. Quitting with error, no action taken." exit 1 else echo "passed." fi echo -n "Restarting $DESC: " start-stop-daemon --stop --pidfile $PIDFILE --name $PNAME \ --retry 5 --oknodo start-stop-daemon --start --pidfile $PIDFILE --name $PNAME \ $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS echo "$NAME." ;; status) PID=`pidof $DAEMON` if [ x$PID = x ]; then echo "$DAEMON is not running" else echo "$DESC is running with pid[$PID]" fi ;; *) N=/etc/init.d/$SNAME echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2 exit 1 ;; esac exit 0