1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2014 CESNET, z.s.p.o
5 RTPPROXY_BIN
="/usr/bin/rtpproxy"
11 echo "[INFO] rtpproxy instance $2 has started"
17 local default_value
="$3"
19 if [ "$value" != "" ]; then
20 rtpproxy_options
=$rtpproxy_options" $param $value"
22 if [ "$default_value" != "" ]; then
23 rtpproxy_options
=$rtpproxy_options" $param $default_value"
28 check_special_param
(){
31 if [ "$param" != "" ]; then
32 rtpproxy_options
=$rtpproxy_options" $param"
38 local socket opts ipaddr ip6addr rtpproxy_options
40 config_get socket
"$site" socket
41 config_get opts
"$site" opts
42 config_get ipaddr
"$site" ipaddr
43 config_get ip6addr
"$site" ip6addr
44 config_get user
"$site" user
46 check_param
"-s" "$socket"
47 check_param
"-l" "$ipaddr"
48 check_param
"-6" "$ip6addr"
49 check_param
"-u" "$user" "nobody"
50 check_special_param
"$opts"
52 run_instance
"$rtpproxy_options" "$site"
57 local section
="global"
58 config_get_bool enabled global enabled
0
60 if [ "$enabled" -eq 1 ]; then
61 config_foreach handle_instance instance
63 echo "[WARNING] rtpproxy not yet configured. Edit /etc/config/rtpproxy first."