blob: 50c0242ec931ee04129478fa2855891979e24940 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/bin/sh
# PROVIDE: miniupnpc
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
# KEYWORD: shutdown
#
# 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:="NO"}
command="%%PREFIX%%/bin/upnpc"
start_cmd="miniupnpc_start"
stop_cmd="miniupnpc_stop"
miniupnpc_start()
{
eval "${command} -r ${miniupnpc_config} | grep duration"
}
miniupnpc_stop()
{
echo "Remove redirections" ${miniupnpc_config}
eval ${command} -d ${miniupnpc_config} > /dev/null
}
run_rc_command "$1"
|