SOURCES: ircservices-ptlink.init (NEW) - added

aredridel aredridel at pld-linux.org
Fri Oct 21 03:30:30 CEST 2005


Author: aredridel                    Date: Fri Oct 21 01:30:30 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added

---- Files affected:
SOURCES:
   ircservices-ptlink.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ircservices-ptlink.init
diff -u /dev/null SOURCES/ircservices-ptlink.init:1.1
--- /dev/null	Fri Oct 21 03:30:30 2005
+++ SOURCES/ircservices-ptlink.init	Fri Oct 21 03:30:25 2005
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# ircservices		This shell script takes care of starting and stopping ircservices.
+#
+# chkconfig:	234 75 30
+# description:	Internet Relay Chat Server.
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/ircservices ] && . /etc/sysconfig/ircservices
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down "IRC Services Server"
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+
+# See how we were called.
+case "$1" in
+  start)
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/ircservices ]; then
+		# Start daemons.
+		msg_starting "IRC Services Server"
+		find /var/lib/ircservices -maxdepth 1 -name stats.today -mtime +1 | xargs rm
+		daemon ircservices
+		touch /var/lock/subsys/ircservices
+	else
+		msg_already_running "IRC Services Server"
+	fi
+	;;
+  stop)
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/ircservices ]; then
+		# Stop daemons.
+		msg_stopping "IRC Services Server"
+		killproc ircservices
+		rm -f /var/run/ircservices.pid /var/lock/subsys/ircservices >/dev/null 2>&1
+	else
+		msg_already_running "IRC Services Server"
+	fi
+	;;
+  restart|force-reload)
+  	$0 stop
+	$0 start
+	exit $?
+	;;
+  status)
+  	status ircservices
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|force-reload|status}"
+	exit 3
+esac
+
+exit 0
================================================================



More information about the pld-cvs-commit mailing list