Browse Source

udpxy: Simplify configuration.

This fixes https://dev.openwrt.org/ticket/16863.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Álvaro Fernández Rojas 10 years ago
parent
commit
bcd2e39bfa
3 changed files with 29 additions and 30 deletions
  1. 1
    1
      net/udpxy/Makefile
  2. 9
    9
      net/udpxy/files/udpxy.conf
  3. 19
    20
      net/udpxy/files/udpxy.init

+ 1
- 1
net/udpxy/Makefile View File

@@ -11,7 +11,7 @@ PKG_NAME:=udpxy
11 11
 PKG_REV:=1.0.23
12 12
 PKG_TAG:=9
13 13
 PKG_VERSION:=$(PKG_REV)-$(PKG_TAG)
14
-PKG_RELEASE:=3
14
+PKG_RELEASE:=4
15 15
 
16 16
 PKG_SOURCE:=$(PKG_NAME).$(PKG_REV)-$(patsubst %,%-prod,$(PKG_TAG)).tar.gz
17 17
 PKG_SOURCE_URL:=http://www.udpxy.com/download/1_23

+ 9
- 9
net/udpxy/files/udpxy.conf View File

@@ -1,13 +1,13 @@
1 1
 config udpxy
2 2
 	option verbose '0'
3 3
 	option status '1'
4
-	option bind '0.0.0.0'
4
+	# option bind '0.0.0.0'
5 5
 	option port '4022'
6
-	option source '0.0.0.0'
7
-	option max_clients '3'
8
-	option log_file '/var/log/udpxy'
9
-	option buffer_size '2048'
10
-	option buffer_messages '1'
11
-	option buffer_time '1'
12
-	option nice_increment '0'
13
-	option mcsub_renew '0'
6
+	# option source '0.0.0.0'
7
+	# option max_clients '3'
8
+	# option log_file '/var/log/udpxy'
9
+	# option buffer_size '4096'
10
+	# option buffer_messages '-1'
11
+	# option buffer_time '-1'
12
+	# option nice_increment '0'
13
+	# option mcsub_renew '0'

+ 19
- 20
net/udpxy/files/udpxy.init View File

@@ -23,33 +23,32 @@ udpxy_parse() {
23 23
 
24 24
 	config_get_bool cfg_verbose $cfg 'verbose' 0
25 25
 	config_get_bool cfg_status $cfg 'status' 1
26
-	config_get cfg_bind $cfg 'bind' '0.0.0.0'
26
+	config_get cfg_bind $cfg 'bind'
27 27
 	config_get cfg_port $cfg 'port' '4022'
28
-	config_get cfg_source $cfg 'source' '0.0.0.0'
29
-	config_get cfg_max_clients $cfg 'max_clients' '3'
30
-	config_get cfg_log_file $cfg 'log_file' '/var/log/udpxy'
31
-	config_get cfg_buffer_size $cfg 'buffer_size' '2048'
32
-	config_get cfg_buffer_messages $cfg 'buffer_messages' '1'
33
-	config_get cfg_buffer_time $cfg 'buffer_time' '1'
34
-	config_get cfg_nice_increment $cfg 'nice_increment' '0'
35
-	config_get cfg_mcsub_renew $cfg 'mcsub_renew' 0
28
+	config_get cfg_source $cfg 'source'
29
+	config_get cfg_max_clients $cfg 'max_clients'
30
+	config_get cfg_log_file $cfg 'log_file'
31
+	config_get cfg_buffer_size $cfg 'buffer_size'
32
+	config_get cfg_buffer_messages $cfg 'buffer_messages'
33
+	config_get cfg_buffer_time $cfg 'buffer_time'
34
+	config_get cfg_nice_increment $cfg 'nice_increment'
35
+	config_get cfg_mcsub_renew $cfg 'mcsub_renew'
36 36
 
37 37
 	procd_open_instance
38 38
 
39 39
 	procd_set_param command /usr/bin/udpxy
40
-	procd_append_param command -T
40
+	procd_append_param command -T -p $cfg_port
41 41
 	[ "$cfg_verbose" -eq 1 ] && procd_append_param command -v
42 42
 	[ "$cfg_status" -eq 1 ] && procd_append_param command -S
43
-	procd_append_param command -a $cfg_bind
44
-	procd_append_param command -p $cfg_port
45
-	procd_append_param command -m $cfg_source
46
-	procd_append_param command -c $cfg_max_clients
47
-	procd_append_param command -l $cfg_log_file
48
-	[ "$cfg_nice_increment" -ge 4096 ] && procd_append_param command -B $cfg_buffer_size
49
-	procd_append_param command -R $cfg_buffer_messages
50
-	procd_append_param command -H $cfg_buffer_time
51
-	[ "$cfg_nice_increment" -ne 0 ] && procd_append_param command -n $cfg_nice_increment
52
-	procd_append_param command -M $cfg_mcsub_renew
43
+	[ ! -z "$cfg_bind" ] && procd_append_param command -a $cfg_bind
44
+	[ ! -z "$cfg_source" ] && procd_append_param command -m $cfg_source
45
+	[ ! -z "$cfg_max_clients" ] && procd_append_param command -c $cfg_max_clients
46
+	[ ! -z "$cfg_log_file" ] && procd_append_param command -l $cfg_log_file
47
+	[ ! -z "$cfg_buffer_size" ] && procd_append_param command -B $cfg_buffer_size
48
+	[ ! -z "$cfg_buffer_messages" ] && procd_append_param command -R $cfg_buffer_messages
49
+	[ ! -z "$cfg_buffer_time" ] && procd_append_param command -H $cfg_buffer_time
50
+	[ ! -z "$cfg_nice_increment" ] && procd_append_param command -n $cfg_nice_increment
51
+	[ ! -z "$cfg_mcsub_renew" ] && procd_append_param command -M $cfg_mcsub_renew
53 52
 
54 53
 	procd_set_param respawn
55 54
 	procd_close_instance