luci-app-chinadns: fix errors
This commit is contained in:
parent
2417d0e02d
commit
10cd9a0a3e
@ -18,7 +18,7 @@ o = s:option(Flag, "enable", translate("Enable"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "yn_use_proxy",
|
||||
translate("Used a proxy or not")
|
||||
translate("Used a proxy or not"),
|
||||
translate("If you used a proxy like shadowsocks, please tick this option."))
|
||||
o.rmenpty = false
|
||||
|
||||
@ -40,7 +40,6 @@ o = s:option(Value, "foreign_subnet",
|
||||
o.placeholder = "45.76.96.0"
|
||||
o.default = "45.76.96.0"
|
||||
o.datatype = "ipaddr"
|
||||
o.rmempty = false
|
||||
o:depends("yn_use_proxy", 0)
|
||||
|
||||
o = s:option(Value, "server",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
config chinadns
|
||||
option chnroute '/etc/chinadns_chnroute.txt'
|
||||
option enable '0'
|
||||
option yn_use_proxy '0'
|
||||
option port '5300'
|
||||
option server '8.8.8.8'
|
||||
option foreign_subnet '45.76.96.0'
|
||||
|
||||
@ -44,7 +44,7 @@ start_chinadns() {
|
||||
[ "$enable" = 1 ] || return 0
|
||||
config_get_bool yn_use_proxy $1 yn_use_proxy
|
||||
[ "$yn_use_proxy" = 0 ] && local foreign_subnet && config_get foreign_subnet $1 foreign_subnet
|
||||
[ "$yn_use_proxy" = 1 ] && local foregin_subnet=$(echo `curl -4 -s ip.sb | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.'`0)
|
||||
[ "$yn_use_proxy" = 1 ] && local foreign_subnet=$(echo `curl -4 -s ip.sb | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.'`0)
|
||||
append_parm $1 port "-p"
|
||||
append_parm $1 server "-s"
|
||||
append_parm $1 chnroute "-c"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user