diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-11-24 11:37:24 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-11-24 11:37:24 +0100 |
commit | 91532de6179704e4c69f1580274123f5956baf03 (patch) | |
tree | 7cf060e8ae2e21ee47e38741264fddc62394d5ad /applications/luci-ddns/luasrc/tools | |
parent | df61ddaf87170e3c7d419133dc616b2b3df13690 (diff) | |
parent | 157e8e52aef5ede350e17ce688f76fbaddea5dd2 (diff) |
Merge pull request #256 from chris5560/master
luci-app-ddns: modified to support ddns-scripts 2.1.0-2
Diffstat (limited to 'applications/luci-ddns/luasrc/tools')
-rw-r--r-- | applications/luci-ddns/luasrc/tools/ddns.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/applications/luci-ddns/luasrc/tools/ddns.lua b/applications/luci-ddns/luasrc/tools/ddns.lua index 8d56c92a16..ad7b5e86f2 100644 --- a/applications/luci-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-ddns/luasrc/tools/ddns.lua @@ -44,7 +44,7 @@ end -- check if IPv6 supported by OpenWrt function check_ipv6() - return NXFS.access("/proc/net/ipv6_route") + return NXFS.access("/proc/net/ipv6_route") and NXFS.access("/usr/sbin/ip6tables") end @@ -113,7 +113,7 @@ end -- read version information for given package if installed function ipkg_version(package) - if not package then + if not package then return nil end local info = OPKG.info(package) @@ -121,7 +121,7 @@ function ipkg_version(package) local version = "" local i = 0 for k, v in pairs(info) do - if v.Package == package and v.Status.installed then + if v.Package == package and v.Status.installed then version = v.Version i = i + 1 end @@ -182,7 +182,7 @@ function flag_parse(self, section) if (fvalue ~= cvalue) then self.section.changed = true end else self:remove(section) - self.section.changed = true + self.section.changed = true end end @@ -222,14 +222,14 @@ end function parse_url(url) --, default) -- initialize default parameters local parsed = {} --- for i,v in base.pairs(default or parsed) do +-- for i,v in base.pairs(default or parsed) do -- parsed[i] = v -- end -- remove whitespace -- url = string.gsub(url, "%s", "") -- get fragment - url = string.gsub(url, "#(.*)$", + url = string.gsub(url, "#(.*)$", function(f) parsed.fragment = f return "" @@ -262,7 +262,7 @@ function parse_url(url) --, default) parsed.path = url local authority = parsed.authority - if not authority then + if not authority then return parsed end authority = string.gsub(authority,"^([^@]*)@", |