summaryrefslogtreecommitdiff
path: root/net/miniupnpc/files/miniupnpc.in
diff options
context:
space:
mode:
Diffstat (limited to 'net/miniupnpc/files/miniupnpc.in')
-rw-r--r--net/miniupnpc/files/miniupnpc.in21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/miniupnpc/files/miniupnpc.in b/net/miniupnpc/files/miniupnpc.in
index 04561515d2a9..92020e650e49 100644
--- a/net/miniupnpc/files/miniupnpc.in
+++ b/net/miniupnpc/files/miniupnpc.in
@@ -1,34 +1,37 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
# PROVIDE: miniupnpc
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
# KEYWORD: shutdown
-
-. /etc/rc.subr
-
+#
# Add the following lines to /etc/rc.conf to enable miniupnpc
# miniupnpc_enable="YES"
# miniupnpc_config="port protocol [port2 protocol2] [...]"
+. /etc/rc.subr
+
name="miniupnpc"
+desc="MiniUPnP Client Startup Config"
rcvar=miniupnpc_enable
load_rc_config $name
-miniupnpc_enable=${miniupnpc_enable:-"NO"}
-
+: ${miniupnpc_enable:="NO"}
command="%%PREFIX%%/bin/upnpc"
start_cmd="miniupnpc_start"
stop_cmd="miniupnpc_stop"
-miniupnpc_start() {
+miniupnpc_start()
+{
eval "${command} -r ${miniupnpc_config} | grep duration"
}
-miniupnpc_stop() {
+miniupnpc_stop()
+{
echo "Remove redirections" ${miniupnpc_config}
eval ${command} -d ${miniupnpc_config} > /dev/null
}
run_rc_command "$1"
-
-# eof