udpxy: Simplify configuration.
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 26 Jun 2014 01:09:13 +0000 (03:09 +0200)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Thu, 26 Jun 2014 01:09:13 +0000 (03:09 +0200)
This fixes https://dev.openwrt.org/ticket/16863.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
net/udpxy/Makefile
net/udpxy/files/udpxy.conf
net/udpxy/files/udpxy.init

index 78661cf8a5991bfecd98e941dfbdd3c3f2b990e6..886d5dabe439c0603062063b56a6559ca62ecdff 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=udpxy
 PKG_REV:=1.0.23
 PKG_TAG:=9
 PKG_VERSION:=$(PKG_REV)-$(PKG_TAG)
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME).$(PKG_REV)-$(patsubst %,%-prod,$(PKG_TAG)).tar.gz
 PKG_SOURCE_URL:=http://www.udpxy.com/download/1_23
index 22c9079ad6bf1764c937c9f8a8381196a6966291..8ef2a1e0507b9043435f7b22e360108bd3981652 100644 (file)
@@ -1,13 +1,13 @@
 config udpxy
        option verbose '0'
        option status '1'
-       option bind '0.0.0.0'
+       option bind '0.0.0.0'
        option port '4022'
-       option source '0.0.0.0'
-       option max_clients '3'
-       option log_file '/var/log/udpxy'
-       option buffer_size '2048'
-       option buffer_messages '1'
-       option buffer_time '1'
-       option nice_increment '0'
-       option mcsub_renew '0'
+       option source '0.0.0.0'
+       option max_clients '3'
+       option log_file '/var/log/udpxy'
+       # option buffer_size '4096'
+       # option buffer_messages '-1'
+       # option buffer_time '-1'
+       option nice_increment '0'
+       option mcsub_renew '0'
index 183a20045caa0c835352f69888428bfe4d17e889..a08f4a1348ca06981a3d7d13c7e55b3ac560f617 100644 (file)
@@ -23,33 +23,32 @@ udpxy_parse() {
 
        config_get_bool cfg_verbose $cfg 'verbose' 0
        config_get_bool cfg_status $cfg 'status' 1
-       config_get cfg_bind $cfg 'bind' '0.0.0.0'
+       config_get cfg_bind $cfg 'bind'
        config_get cfg_port $cfg 'port' '4022'
-       config_get cfg_source $cfg 'source' '0.0.0.0'
-       config_get cfg_max_clients $cfg 'max_clients' '3'
-       config_get cfg_log_file $cfg 'log_file' '/var/log/udpxy'
-       config_get cfg_buffer_size $cfg 'buffer_size' '2048'
-       config_get cfg_buffer_messages $cfg 'buffer_messages' '1'
-       config_get cfg_buffer_time $cfg 'buffer_time' '1'
-       config_get cfg_nice_increment $cfg 'nice_increment' '0'
-       config_get cfg_mcsub_renew $cfg 'mcsub_renew' 0
+       config_get cfg_source $cfg 'source'
+       config_get cfg_max_clients $cfg 'max_clients'
+       config_get cfg_log_file $cfg 'log_file'
+       config_get cfg_buffer_size $cfg 'buffer_size'
+       config_get cfg_buffer_messages $cfg 'buffer_messages'
+       config_get cfg_buffer_time $cfg 'buffer_time'
+       config_get cfg_nice_increment $cfg 'nice_increment'
+       config_get cfg_mcsub_renew $cfg 'mcsub_renew'
 
        procd_open_instance
 
        procd_set_param command /usr/bin/udpxy
-       procd_append_param command -T
+       procd_append_param command -T -p $cfg_port
        [ "$cfg_verbose" -eq 1 ] && procd_append_param command -v
        [ "$cfg_status" -eq 1 ] && procd_append_param command -S
-       procd_append_param command -a $cfg_bind
-       procd_append_param command -p $cfg_port
-       procd_append_param command -m $cfg_source
-       procd_append_param command -c $cfg_max_clients
-       procd_append_param command -l $cfg_log_file
-       [ "$cfg_nice_increment" -ge 4096 ] && procd_append_param command -B $cfg_buffer_size
-       procd_append_param command -R $cfg_buffer_messages
-       procd_append_param command -H $cfg_buffer_time
-       [ "$cfg_nice_increment" -ne 0 ] && procd_append_param command -n $cfg_nice_increment
-       procd_append_param command -M $cfg_mcsub_renew
+       [ ! -z "$cfg_bind" ] && procd_append_param command -a $cfg_bind
+       [ ! -z "$cfg_source" ] && procd_append_param command -m $cfg_source
+       [ ! -z "$cfg_max_clients" ] && procd_append_param command -c $cfg_max_clients
+       [ ! -z "$cfg_log_file" ] && procd_append_param command -l $cfg_log_file
+       [ ! -z "$cfg_buffer_size" ] && procd_append_param command -B $cfg_buffer_size
+       [ ! -z "$cfg_buffer_messages" ] && procd_append_param command -R $cfg_buffer_messages
+       [ ! -z "$cfg_buffer_time" ] && procd_append_param command -H $cfg_buffer_time
+       [ ! -z "$cfg_nice_increment" ] && procd_append_param command -n $cfg_nice_increment
+       [ ! -z "$cfg_mcsub_renew" ] && procd_append_param command -M $cfg_mcsub_renew
 
        procd_set_param respawn
        procd_close_instance