summaryrefslogtreecommitdiff
path: root/network/elemental-ircd/rc.elemental-ircd
diff options
context:
space:
mode:
Diffstat (limited to 'network/elemental-ircd/rc.elemental-ircd')
-rw-r--r--network/elemental-ircd/rc.elemental-ircd53
1 files changed, 53 insertions, 0 deletions
diff --git a/network/elemental-ircd/rc.elemental-ircd b/network/elemental-ircd/rc.elemental-ircd
new file mode 100644
index 0000000000..9af9f68ef9
--- /dev/null
+++ b/network/elemental-ircd/rc.elemental-ircd
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# elemental-ircd startup script for Slackware
+
+USER="@USER@"
+PIDFILE="/var/run/elemental-ircd/ircd.pid"
+PID=`cat $PIDFILE 2>/dev/null`
+
+ircd_start() {
+ echo "Starting elemental-ircd."
+ su - $USER -c "/usr/bin/ircd -pidfile $PIDFILE"
+}
+
+ircd_stop() {
+ echo -n "Stopping elemental-ircd..."
+ kill -TERM $PID 2>/dev/null
+ echo " done."
+}
+
+ircd_reload() {
+ echo -n "Sending signal to elemental-ircd to reload its configuration..."
+ if kill -CHLD $PID 2>/dev/null; then
+ kill -HUP $PID
+ echo " done."
+ else
+ echo "ircd doesn't seem to be running."
+ exit 1
+ fi
+}
+
+ircd_restart() {
+ ircd_stop
+ sleep 1
+ ircd_start
+}
+
+case "$1" in
+ start)
+ ircd_start
+ ;;
+ stop)
+ ircd_stop
+ ;;
+ restart)
+ ircd_restart
+ ;;
+ reload)
+ ircd_reload
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+esac