From f06b41206439a0249536335159d3a2612233386c Mon Sep 17 00:00:00 2001 From: Grant Bowman Date: Tue, 24 Aug 2004 23:44:57 +0000 Subject: [PATCH] First version of an /etc/init.d/supybot script targeted at Debian systems. Additional checks will be required for validating that absolute pathnames are used in the conf file. This script should be considered experimental until the pathname validation issues can be addressed, perhaps with additional command-line arguments. --- sandbox/supybot | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 sandbox/supybot diff --git a/sandbox/supybot b/sandbox/supybot new file mode 100755 index 000000000..542eae35c --- /dev/null +++ b/sandbox/supybot @@ -0,0 +1,56 @@ +#! /bin/sh +# +# startbot /etc/init.d/ script for running an irc bot. +# +# This is untested and not recommended for use yet! +# See the supybot documentation. +# +# Author: Grant Bowman +# +# Version: $Id$ +# @(#)skeleton 1.9.4 21-Mar-2004 miquels@cistron.nl +# + +set -e + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/supybot +NAME=supybot +DESC="irc bot" + +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME +CONFFILE=/etc/$NAME.conf + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +case "$1" in + start) + echo -n "Starting $DESC: $NAME" + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec $DAEMON $CONFFILE + echo "." + ;; + stop) + echo -n "Stopping $DESC: $NAME" + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON $CONFFILE + echo "." + ;; + restart|force-reload) + echo -n "Restarting $DESC: $NAME" + start-stop-daemon --stop --quiet --oknodo --pidfile \ + $PIDFILE --exec $DAEMON $CONFFILE + sleep 1 + start-stop-daemon --start --quiet --pidfile \ + $PIDFILE --exec $DAEMON $CONFFILE + echo "." + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0