#!/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
# Source function library.
. /etc/init.d/functions
# See how we were called.
case "$1" in
start)
echo -n "Starting SQLgrey: "
# SQLite put files in the working directory
cd ~sqlgrey
sqlgrey -d
echo_success
echo
;;
stop)
echo -n "Shutting down SQLgrey: "
sqlgrey -k
echo_success
echo
;;
status)
status sqlgrey
;;
restart)
$0 stop
sleep 1 # hack: missing REUSEADDR from Net::Server?
$0 start
;;
*)
echo "Usage: sqlgrey {start|stop|status|restart}"
exit 1
esac
exit 0
syntax highlighted by Code2HTML, v. 0.9.1