fix ota update for PocketBook

This commit is contained in:
chrox
2015-01-20 00:07:36 +08:00
parent 917f45a5ba
commit c11a2bbf1e
4 changed files with 8 additions and 12 deletions

View File

@@ -73,17 +73,8 @@ function NetworkMgr:promptWifiOff()
end
function NetworkMgr:getWifiStatus()
local default_string = io.popen("ip r | grep default")
if not default_string then return false end
local result = default_string:read()
default_string:close()
if result ~= nil then
local gateway = string.match(result,"%d+.%d+.%d+.%d+")
if gateway and os.execute("ping -q -c1 "..gateway) == 0 then
return true
end -- ping to gateway
end -- test for empty string
return false
local socket = require("socket")
return socket.dns.toip("www.google.com") ~= nil
end
function NetworkMgr:setHTTPProxy(proxy)