aboutsummaryrefslogtreecommitdiff
path: root/network/miniupnpd/rc.miniupnpd
diff options
context:
space:
mode:
Diffstat (limited to 'network/miniupnpd/rc.miniupnpd')
-rw-r--r--network/miniupnpd/rc.miniupnpd53
1 files changed, 53 insertions, 0 deletions
diff --git a/network/miniupnpd/rc.miniupnpd b/network/miniupnpd/rc.miniupnpd
new file mode 100644
index 0000000000000..1d8b6c594fd36
--- /dev/null
+++ b/network/miniupnpd/rc.miniupnpd
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# $Id: miniupnpd.init.d.script,v 1.2 2007/09/23 16:11:12 nanard Exp $
+# MiniUPnP project
+# author: Thomas Bernard
+# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
+
+# Re-created from scratch by the SlackBuild's author Pablo Oses <opablo@gmail.com>
+# using the simple service start/stop/restart script template
+
+SERVICENAME="miniupnpd"
+CONFIGPATH=/etc/miniupnpd
+BINPATH=/usr/sbin
+
+# Start service:
+start()
+{
+ echo -n "Starting $SERVICENAME..."
+ ${CONFIGPATH}/iptables_init.sh > /dev/null 2>&1
+ ${BINPATH}/miniupnpd -f ${CONFIGPATH}/miniupnpd.conf
+ echo
+}
+
+# Stop service:
+stop()
+{
+ echo -n "Stopping ${SERVICENAME}... "
+ killall miniupnpd
+ ${CONFIGPATH}/iptables_removeall.sh > /dev/null 2>&1
+ echo
+}
+
+# Restart service:
+restart()
+{
+ stop
+ sleep 1
+ start
+}
+
+case "$1" in
+ 'start')
+ start
+ ;;
+ 'stop')
+ stop
+ ;;
+ 'restart')
+ restart
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac