From 7e48285cb476671b5b4b9d54bb84d48fd6f45329 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Wed, 7 Feb 2018 15:20:38 +0100 Subject: [PATCH] Lowercase is better for glorytun proto --- glorytun-udp/init | 2 +- glorytun/glorytun.config | 2 +- glorytun/init | 2 +- luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua | 2 +- luci-app-glorytun/luasrc/model/cbi/glorytun.lua | 4 ++-- luci-app-glorytun/root/etc/config/glorytun_recipes | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glorytun-udp/init b/glorytun-udp/init index 920c264cf..470a2e3c7 100755 --- a/glorytun-udp/init +++ b/glorytun-udp/init @@ -42,7 +42,7 @@ start_instance() { } [ "${enable}" = "1" ] || return 1 - [ "${proto}" = "UDP" ] || return 1 + [ "${proto}" = "udp" ] || return 1 [ -n "${key}" ] || return 1 [ -n "${port}" ] || return 1 diff --git a/glorytun/glorytun.config b/glorytun/glorytun.config index 110d6800d..eb026aaac 100644 --- a/glorytun/glorytun.config +++ b/glorytun/glorytun.config @@ -5,4 +5,4 @@ config glorytun 'vpn' option dev 'tun0' option key 'secretkey' option mptcp '1' - option proto 'TCP' + option proto 'tcp' diff --git a/glorytun/init b/glorytun/init index df7512af6..2f2103841 100755 --- a/glorytun/init +++ b/glorytun/init @@ -39,7 +39,7 @@ start_instance() { } [ "${enable}" = "1" ] || return 1 - [ "${proto}" = "TCP" ] || return 1 + [ "${proto}" = "tcp" ] || return 1 [ -n "${key}" ] || return 1 [ -n "${port}" ] || return 1 [ -n "${dev}" ] || return 1 diff --git a/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua b/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua index 5b07d03e9..914431c4e 100644 --- a/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua +++ b/luci-app-glorytun/luasrc/model/cbi/glorytun-settings.lua @@ -16,7 +16,7 @@ local basicParams = { { Value,"localip","192.168.99.2", translate("Local tunnel ip address") }, { Value,"remoteip","192.168.99.1", translate("Remote tunnel ip address") }, { Value,"key","secretkey", translate("The secret key") }, - { ListValue,"proto",{ "TCP", "UDP" }, translate("Protocol") }, + { ListValue,"proto",{ "tcp", "udp" }, translate("Protocol") }, { Flag,"listener",0, translate("Server mode") }, { Value,"bind","", translate("Bind address") }, diff --git a/luci-app-glorytun/luasrc/model/cbi/glorytun.lua b/luci-app-glorytun/luasrc/model/cbi/glorytun.lua index f9e804b32..4055b5cc7 100644 --- a/luci-app-glorytun/luasrc/model/cbi/glorytun.lua +++ b/luci-app-glorytun/luasrc/model/cbi/glorytun.lua @@ -115,7 +115,7 @@ end local proto = s:option( DummyValue, "proto", translate("Protocol") ) function proto.cfgvalue(self, section) local val = AbstractValue.cfgvalue(self, section) - return val or "TCP" + return val or "tcp" end function updown.write(self, section, value) @@ -126,7 +126,7 @@ function updown.write(self, section, value) end else local type = proto.cfgvalue(self,section) - if type == 'UDP' then + if type == 'udp' then luci.sys.call("/etc/init.d/glorytun-udp start %s" % section) else luci.sys.call("/etc/init.d/glorytun start %s" % section) diff --git a/luci-app-glorytun/root/etc/config/glorytun_recipes b/luci-app-glorytun/root/etc/config/glorytun_recipes index ea4144780..919acc2a8 100644 --- a/luci-app-glorytun/root/etc/config/glorytun_recipes +++ b/luci-app-glorytun/root/etc/config/glorytun_recipes @@ -7,7 +7,7 @@ config glorytun_recipe servertcp option listener "1" option localip "192.168.99.1" option remoteip "192.168.99.2" - option proto "TCP" + option proto "tcp" config glorytun_recipe clienttcp option _description "Simple TCP client configuration" @@ -18,7 +18,7 @@ config glorytun_recipe clienttcp option key "secretkey" option localip "192.168.99.2" option remoteip "192.168.99.1" - option proto "TCP" + option proto "tcp" config glorytun_recipe serverudp option _description "Simple UDP server configuration" @@ -29,7 +29,7 @@ config glorytun_recipe serverudp option key "secretkey" option localip "192.168.99.1" option remoteip "192.168.99.2" - option proto "UDP" + option proto "udp" option mtuauto "1" config glorytun_recipe clientudp @@ -41,5 +41,5 @@ config glorytun_recipe clientudp option key "secretkey" option localip "192.168.99.2" option remoteip "192.168.99.1" - option proto "UDP" + option proto "udp" option mtuauto "1"