From fb11c8ab4558c7c6a10ff3ee66de248844a75909 Mon Sep 17 00:00:00 2001 From: jevonearth Date: Wed, 19 Oct 2016 16:28:26 -0700 Subject: [PATCH 1/2] Update and add doc comments to the FreeBSD rc script --- scripts/rtpproxy.in.freebsd | 54 +++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/scripts/rtpproxy.in.freebsd b/scripts/rtpproxy.in.freebsd index ebeee905d..1360c2cea 100755 --- a/scripts/rtpproxy.in.freebsd +++ b/scripts/rtpproxy.in.freebsd @@ -1,28 +1,48 @@ #!/bin/sh -# Add the following lines to /etc/rc.conf to enable RTPproxy: -# -# rtpproxy_enable="YES" - # PROVIDE: rtpproxy # REQUIRE: DAEMON -# BEFORE: ser openser - -prefix=%%PREFIX%% - -. %%RC_SUBR%% +# BEFORE: kamailio opensips +# +# Add the following lines to /etc/rc.conf to enable RTPproxy: +# +# rtpproxy_enable (bool): Set to NO by default +# Set it to YES to enable rtpproxy +# rtpproxy_laddr (string): Set listen address +# Default is "0.0.0.0" +# rtpproxy_ctrl_socket (string): Set control socket location +# Default is "/var/run/rtpproxy.sock" +# rtpproxy_paddr (string): Set advertised address +# Default is "0.0.0.0" +# rtpproxy_usr (string): Set user to run rtpproxy +# Default is "rtpproxy" +# rtpproxy_grp (string): Set group to run rtpproxy +# Default is "rtpproxy" +# rtpproxy_args (string): Set additional command line arguments +# Default is "" + +. /etc/rc.subr name=rtpproxy -rcvar=`set_rcvar` - -command="${prefix}/bin/rtpproxy" -pidfile="/var/run/rtpproxy.pid" +desc="rtpproxy daemon startup script" +rcvar=rtpproxy_enable load_rc_config ${name} -rtpproxy_enable=${rtpproxy_enable:-"NO"} -rtpproxy_laddr=${rtpproxy_laddr:-"0.0.0.0"} +prefix=/usr/local +command=${prefix}/bin/rtpproxy +pidfile=/var/run/rtpproxy.pid + + +: ${rtpproxy_enable:-"NO"} +: ${rtpproxy_laddr:-"0.0.0.0"} +: ${rtpproxy_ctrl_socket:-"unix:/var/run/rtpproxy.sock"} +: ${rtpproxy_paddr:-"0.0.0.0"} +: ${rtpproxy_usr:-"rtpproxy"} +: ${rtpproxy_grp:-"rtpproxy"} +: ${rtpproxy_args:-""} -command_args="-l ${rtpproxy_laddr} -p /var/run/rtpproxy.pid" +command_args="-u ${rtpproxy_usr}:${rtpproxy_grp} -A ${rtpproxy_paddr} -F -l ${rtpproxy_laddr} \ + -s ${rtpproxy_ctrl_socket} -d INFO -p /var/run/rtpproxy.pid ${rtpproxy_args}" -run_rc_command "${1}" +run_rc_command $1 From c3cdf438a5f655e53709b3afbc0fa1585889e844 Mon Sep 17 00:00:00 2001 From: jevonearth Date: Thu, 20 Oct 2016 09:39:03 -0700 Subject: [PATCH 2/2] Add quotes to $1 on run_rc_command --- scripts/rtpproxy.in.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rtpproxy.in.freebsd b/scripts/rtpproxy.in.freebsd index 1360c2cea..1493ec6a1 100755 --- a/scripts/rtpproxy.in.freebsd +++ b/scripts/rtpproxy.in.freebsd @@ -45,4 +45,4 @@ pidfile=/var/run/rtpproxy.pid command_args="-u ${rtpproxy_usr}:${rtpproxy_grp} -A ${rtpproxy_paddr} -F -l ${rtpproxy_laddr} \ -s ${rtpproxy_ctrl_socket} -d INFO -p /var/run/rtpproxy.pid ${rtpproxy_args}" -run_rc_command $1 +run_rc_command "$1"