udpspeeder: add key option
authorTan Xiaofan <xfan1024@live.com>
Wed, 1 Jun 2022 06:46:00 +0000 (14:46 +0800)
committerRosen Penev <rosenp@gmail.com>
Thu, 9 Jun 2022 18:04:31 +0000 (11:04 -0700)
Signed-off-by: Tan Xiaofan <xfan1024@live.com>
net/udpspeeder/files/udpspeeder-init

index 33436d0ee64f9df70e70691a24b66ab54af3ed88..3b21acf19e0b80401fd373bc50ea0f7b1e562489 100755 (executable)
@@ -17,6 +17,7 @@ validate_udpspeeder_section() {
                'timeout:integer:8'             \
                'local:string'                  \
                'remote:string'                 \
+               'key:string'                    \
                'report:integer:10'             \
                'disable_obscure:bool:0'        \
                'interval:integer:0'            \
@@ -33,8 +34,8 @@ start_instance() {
 
        local section="$1"
 
-       local server mode mtu timeout local remote report disable_obscure fifo interval fec disable_fec sock_buf queue_len \
-               decode_buf sock_buf log_level enabled
+       local server mode mtu timeout local remote key report disable_obscure fifo interval \
+               fec disable_fec sock_buf queue_len decode_buf sock_buf log_level enabled
 
        fifo="/tmp/udpspeeder-${section}.fifo"
 
@@ -79,6 +80,8 @@ start_instance() {
                procd_append_param command --disable-obscure
        fi
 
+       [ -z "${key}" ]  || procd_append_param command --key "${key}"
+
        procd_append_param command -l "${local}"
        procd_append_param command -r "${remote}"
        procd_append_param command --mode "${mode}"