Merge pull request #3318 from Ansuel/rework-ddns
luci-app-ddns: fix missing check for bindhost
This commit is contained in:
commit
eaa193336f
1 changed files with 20 additions and 4 deletions
|
@ -228,12 +228,28 @@ local methods = {
|
||||||
res['has_bindnet'] = has_curl() or has_wgetssl() or false
|
res['has_bindnet'] = has_curl() or has_wgetssl() or false
|
||||||
|
|
||||||
local function has_bindhost()
|
local function has_bindhost()
|
||||||
if (sys.call( [[which host >/dev/null 2>&1]] ) == 0) then return true end
|
if cache['has_bindhost'] then return cache['has_bindhost'] end
|
||||||
if (sys.call( [[which khost >/dev/null 2>&1]] ) == 0) then return true end
|
local res = (sys.call( [[which host >/dev/null 2>&1]] ) == 0)
|
||||||
if (sys.call( [[which drill >/dev/null 2>&1]] ) == 0) then return true end
|
if res then
|
||||||
|
cache['has_bindhost'] = res
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
res = (sys.call( [[which khost >/dev/null 2>&1]] ) == 0)
|
||||||
|
if res then
|
||||||
|
cache['has_bindhost'] = res
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
res = (sys.call( [[which drill >/dev/null 2>&1]] ) == 0)
|
||||||
|
if res then
|
||||||
|
cache['has_bindhost'] = res
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
cache['has_bindhost'] = false
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
res['has_bindhost'] = cache['has_bindhost'] or has_bindhost() or false
|
||||||
|
|
||||||
local function has_hostip()
|
local function has_hostip()
|
||||||
return (sys.call( [[which hostip >/dev/null 2>&1]] ) == 0)
|
return (sys.call( [[which hostip >/dev/null 2>&1]] ) == 0)
|
||||||
end
|
end
|
||||||
|
@ -242,7 +258,7 @@ local methods = {
|
||||||
return (sys.call( [[which nslookup >/dev/null 2>&1]] ) == 0)
|
return (sys.call( [[which nslookup >/dev/null 2>&1]] ) == 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
res['has_dnsserver'] = has_bindhost() or has_hostip() or has_nslookup() or false
|
res['has_dnsserver'] = cache['has_bindhost'] or has_nslookup() or has_hostip() or has_bindhost() or false
|
||||||
|
|
||||||
local function check_certs()
|
local function check_certs()
|
||||||
local _, v = fs.glob("/etc/ssl/certs/*.crt")
|
local _, v = fs.glob("/etc/ssl/certs/*.crt")
|
||||||
|
|
Loading…
Reference in a new issue