File: sqlgrey.debian

package info (click to toggle)
sqlgrey 1%3A1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 556 kB
  • ctags: 352
  • sloc: perl: 3,029; sh: 233; makefile: 118
file content (51 lines) | stat: -rwxr-xr-x 1,084 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# sqlgrey:        Init script for sqlgrey postfix policy service
#
# chkconfig: 345 90 10
# description: SQLgrey is a postfix grey-listing policy service.
# pidfile: /var/run/sqlgrey.pid
#
# Hacked from the RH version  Karl O. Pinc <kop@meme.com>

# Source function library.
#. /etc/init.d/functions

SQLGREY=/usr/sbin/sqlgrey

# See how we were called.
case "$1" in
  start)
	echo -n "Starting sqlgrey: "
	# SQLite put files in the working directory
        ERRMSG=$(/sbin/start-stop-daemon --chdir ~sqlgrey --pidfile /var/run/sqlgrey.pid --oknodo --startas $SQLGREY --start -- -d 2>&1)

	if [ $? != 0 ]; then
	    echo "(FAILED)"
	    [ "$ERRMSG" ] && echo "ERROR: $ERRMSG" >&2 || true
	    exit 1
	fi

        [ "$ERRMSG" ] && echo -n " ($ERRMSG)" >&2 || true
        echo "done."
	;;

  stop)
	echo -n "Stopping sqlgrey:"
	sqlgrey -k
	echo " done."
        start-stop-daemon --start --exec $SQLGREY -- -k
	;;

  restart)
	$0 stop
	sleep 1 # hack: missing REUSEADDR from Net::Server?
	$0 start
	;;

  *)
	echo "Usage: sqlgrey {start|stop|restart}"
	exit 1
esac

exit 0