about summary refs log tree commit diff
path: root/contrib/Debian/ngircd.init
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2003-12-31 17:20:11 +0000
committerAlexander Barton <alex@barton.de>2003-12-31 17:20:11 +0000
commited94d5d5cd31ecc1f671f36e0813804e8aa59082 (patch)
treed54a96bd11cf4ce31fbf695ed98a3f2183e75fa5 /contrib/Debian/ngircd.init
parentea076a28f2ff16c0424c0ba488227dbe1d3393bf (diff)
downloadngircd-ed94d5d5cd31ecc1f671f36e0813804e8aa59082.tar.gz
ngircd-ed94d5d5cd31ecc1f671f36e0813804e8aa59082.zip
Removed outdated Mac OS X ProjectBuilder project files (will be re-added
and updated for XCode soon); moved the debian/ directory to contrib/Debian/.
Diffstat (limited to 'contrib/Debian/ngircd.init')
-rwxr-xr-xcontrib/Debian/ngircd.init71
1 files changed, 71 insertions, 0 deletions
diff --git a/contrib/Debian/ngircd.init b/contrib/Debian/ngircd.init
new file mode 100755
index 00000000..206e2f0e
--- /dev/null
+++ b/contrib/Debian/ngircd.init
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# ngIRCd start and stop script for Debian-based systems
+#
+# $Id: ngircd.init,v 1.1 2003/12/31 17:20:11 alex Exp $
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/ngircd
+NAME=ngIRCd
+DESC="IRC daemon"
+PARAMS=""
+
+test -x $DAEMON || exit 0
+
+test -f /etc/default/ngircd && . /etc/default/ngircd
+
+Check_Config()
+{
+	$DAEMON --configtest >/dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo "Configuration of $NAME is not valide, won't (re)start!"
+		echo "Please run \"$DAEMON --configtest\" manually and fix it up ..."
+		exit 1
+	fi
+}
+
+Try_Start()
+{
+	start-stop-daemon --start --quiet --exec $DAEMON -- $PARAMS
+	if [ $? -ne 0 ]; then
+		echo "$NAME failed!"
+		exit 1
+	fi
+	echo "$NAME."
+}
+
+case "$1" in
+  start)
+	Check_Config
+	echo -n "Starting $DESC: "
+	Try_Start
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	start-stop-daemon --stop --quiet --exec $DAEMON \
+	  && echo "$NAME." \
+	  || echo "(none running)"
+	;;
+  reload|force-reload)
+	Check_Config
+	echo "Reloading $DESC configuration files."
+	start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
+	;;
+  restart)
+	Check_Config
+	echo -n "Restarting $DESC: "
+	start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
+	sleep 1
+	Try_Start
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
+
+# -eof-