mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Minor networking fixes on legacy Kindles (#5059)
* Allow toggling WiFi & Suspend on legacy Kindles * Fix ping invocations on Legacy Kindles * Don't crash when disabling WiFi on legacy Kindles
This commit is contained in:
@@ -311,7 +311,13 @@ function Device:retrieveNetworkInfo()
|
||||
std_out:close()
|
||||
end
|
||||
if os.execute("ip r | grep -q default") == 0 then
|
||||
local pingok = os.execute("ping -q -w 3 -c 2 `ip r | grep default | cut -d ' ' -f 3` > /dev/null")
|
||||
-- NOTE: No -w flag available in the old busybox build used on Legacy Kindles...
|
||||
local pingok
|
||||
if self:isKindle() and self:hasKeyboard() then
|
||||
pingok = os.execute("ping -q -c 2 `ip r | grep default | cut -d ' ' -f 3` > /dev/null")
|
||||
else
|
||||
pingok = os.execute("ping -q -w 3 -c 2 `ip r | grep default | cut -d ' ' -f 3` > /dev/null")
|
||||
end
|
||||
if pingok == 0 then
|
||||
result = result .. "Gateway ping successful"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user