Skip to content

Commit 0ea381a

Browse files
josh4trunkssobomax
authored andcommitted
Update rtpproxy.in.freebsd in the upstream source. This will
allow the removable of 'files/patch-scripts_rtpproxy.in.freebsd' in the FreeBSD port. Add shutdown as recommended by 'Practical rc.d scripting in BSD'
1 parent 31b4717 commit 0ea381a

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

scripts/rtpproxy.in.freebsd

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
#!/bin/sh
22

3-
# Add the following lines to /etc/rc.conf to enable RTPproxy:
4-
#
5-
# rtpproxy_enable="YES"
6-
73
# PROVIDE: rtpproxy
84
# REQUIRE: DAEMON
9-
# BEFORE: ser openser
10-
11-
prefix=%%PREFIX%%
5+
# BEFORE: kamailio opensips
6+
# KEYWORD: shutdown
7+
#
8+
# Add the following lines to /etc/rc.conf to enable RTPProxy:
9+
#
10+
# rtpproxy_enable="YES"
11+
#
1212

13-
. %%RC_SUBR%%
13+
. /etc/rc.subr
1414

1515
name=rtpproxy
16-
rcvar=`set_rcvar`
17-
18-
command="${prefix}/bin/rtpproxy"
19-
pidfile="/var/run/rtpproxy.pid"
20-
16+
rcvar=rtpproxy_enable
2117
load_rc_config ${name}
2218

23-
rtpproxy_enable=${rtpproxy_enable:-"NO"}
24-
rtpproxy_laddr=${rtpproxy_laddr:-"0.0.0.0"}
19+
: ${rtpproxy_enable:="NO"}
20+
: ${rtpproxy_ctrl_socket:="unix:/var/run/rtpproxy.sock"}
21+
: ${rtpproxy_laddr:="0.0.0.0"}
22+
: ${rtpproxy_paddr:="0.0.0.0"}
23+
: ${rtpproxy_usr:="rtpproxy"}
24+
: ${rtpproxy_grp:="rtpproxy"}
2525

26-
command_args="-l ${rtpproxy_laddr} -p /var/run/rtpproxy.pid"
26+
command="%%PREFIX%%/bin/rtpproxy"
27+
pidfile="/var/run/rtpproxy.pid"
28+
command_args="-u ${rtpproxy_usr}:${rtpproxy_grp} -A ${rtpproxy_paddr} -l ${rtpproxy_laddr} \
29+
-s ${rtpproxy_ctrl_socket} -p ${pidfile}"
2730

28-
run_rc_command "${1}"
31+
run_rc_command "$1"

0 commit comments

Comments
 (0)