mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
- add rc.d script
Submitted by: Andrey Chernov Feature safe: yes
This commit is contained in:
parent
244a1d0721
commit
ff0496de0b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=293799
2 changed files with 34 additions and 0 deletions
|
@ -23,6 +23,7 @@ USE_LDCONFIG= yes
|
||||||
CONFIGURE_SCRIPT= updateminiupnpcstrings.sh
|
CONFIGURE_SCRIPT= updateminiupnpcstrings.sh
|
||||||
MAKE_ENV+= INSTALLPREFIX=${PREFIX}
|
MAKE_ENV+= INSTALLPREFIX=${PREFIX}
|
||||||
CFLAGS+= -fPIC
|
CFLAGS+= -fPIC
|
||||||
|
USE_RC_SUBR= miniupnpc
|
||||||
|
|
||||||
.include <bsd.port.pre.mk>
|
.include <bsd.port.pre.mk>
|
||||||
|
|
||||||
|
|
33
net/miniupnpc/files/miniupnpc.in
Normal file
33
net/miniupnpc/files/miniupnpc.in
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# PROVIDE: miniupnpc
|
||||||
|
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
# Add the following lines to /etc/rc.conf to enable miniupnpc
|
||||||
|
# miniupnpc_enable="YES"
|
||||||
|
# miniupnpc_config="port protocol [port2 protocol2] [...]"
|
||||||
|
|
||||||
|
name="miniupnpc"
|
||||||
|
rcvar=miniupnpc_enable
|
||||||
|
|
||||||
|
load_rc_config $name
|
||||||
|
|
||||||
|
miniupnpc_enable=${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"
|
||||||
|
|
||||||
|
# eof
|
Loading…
Add table
Reference in a new issue