#!/bin/sh

### BEGIN INIT INFO
# Provides:          pywhoisd
# Required-Start:    $local_fs $network$ $syslog$
# Required-Stop:
# Default-Start:     S
# Default-Stop:
# Short-Description: pywhoisd
# Description:       Whois daemon
### END INIT INFO

. /lib/lsb/init-functions

[ -f /etc/default/rcS ] && . /etc/default/rcS
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PROGRAM="/usr/bin/pywhoisd.py"
PIDFILE="/var/run/pywhoisd.pid"

test -x $PROGRAM || exit 0

case "$1" in
  start)
	log_begin_msg "Starting pywhoisd"
	start-stop-daemon --exec $PROGRAM --make-pidfile -p $PIDFILE --start --background
	log_end_msg $?
	;;
  stop)
	log_begin_msg "Stopping pywhoisd"
	start-stop-daemon --stop -p $PIDFILE
	log_end_msg $?
	;;
  force-reload|restart)
	$0 stop
	$0 start
	;;
  *)
	log_success_msg "Usage: /etc/init.d/sensors {start|stop|restart|force-reload}"
	exit 1
esac

exit 0
ViewGit