SOURCES: miniupnpd.init (NEW) - added

aredridel aredridel at pld-linux.org
Mon Apr 30 21:47:15 CEST 2007


Author: aredridel                    Date: Mon Apr 30 19:47:15 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added

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

---- Diffs:

================================================================
Index: SOURCES/miniupnpd.init
diff -u /dev/null SOURCES/miniupnpd.init:1.1
--- /dev/null	Mon Apr 30 21:47:15 2007
+++ SOURCES/miniupnpd.init	Mon Apr 30 21:47:10 2007
@@ -0,0 +1,99 @@
+#!/bin/sh
+#
+# miniupnpd	miniupnpd UPnP Daemon
+#
+# chkconfig:	345 85 15
+# description:	miniupnpd is a firewall port-mapping daemon
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/miniupnpd ] && . /etc/sysconfig/miniupnpd
+
+# 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 miniupnpd
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	env SHELL=/bin/sh miniupnpd -f /etc/miniupnpd/miniupnpd.conf -P /var/run/miniupnpd.pid
+	RETVAL=$?
+	if [ $RETVAL -eq 0 ]; then
+		ok
+	   	touch /var/lock/subsys/miniupnpd
+	else
+		fail
+	fi
+	return $RETVAL
+}
+
+stop() {
+	killproc --pidfile /var/run/miniupnpd.pid miniupnpd
+	rm -f /var/lock/subsys/miniupnpd >/dev/null 2>&1
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/miniupnpd ]; then
+		msg_starting miniupnpd
+		start
+	else
+		msg_already_running miniupnpd
+	fi
+	;;
+  stop)
+	# Stop daemons.
+	if [ -f /var/lock/subsys/miniupnpd ]; then
+		msg_stopping miniupnpd
+		stop
+	else
+		msg_not_running miniupnpd
+	fi
+	;;
+  status)
+	status miniupnpd
+	RETVAL=$?
+	;;
+  restart)
+	if [ -f /var/lock/subsys/miniupnpd ]; then
+		msg_stopping miniupnpd
+		stop
+		msg_starting miniupnpd
+		start
+		RETVAL=$?
+	else
+		msg_not_running miniupnpd
+		msg_starting miniupnpd
+		start
+	fi
+	;;
+  reload|graceful|force-reload)
+	if [ -f /var/lock/subsys/miniupnpd ]; then
+		msg_reloading miniupnpd
+		reload
+		RETVAL=$?
+	else
+		msg_not_running miniupnpd
+		RETVAL=7
+	fi
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+	exit 3
+	;;
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list