Kindle: Fix retrieveNetworkInfo on the K4 (#9073)

Thanks to @hius07
(https://github.com/koreader/koreader/issues/7881#issuecomment-1028921755)
;).

Fix #7881
This commit is contained in:
NiLuJe
2022-05-07 00:36:42 +02:00
committed by GitHub
parent f286787ff5
commit fa76b9d615

View File

@@ -482,9 +482,9 @@ function Device:retrieveNetworkInfo()
std_out:close()
end
if os.execute("ip r | grep -q default") == 0 then
-- NOTE: No -w flag available in the old busybox build used on Legacy Kindles...
-- NOTE: No -w flag available in the old busybox build used on Legacy Kindles (K4 included)...
local pingok
if self:isKindle() and self:hasKeyboard() then
if self:isKindle() and self:hasDPad() then
pingok = os.execute("ping -q -c 2 `ip r | grep default | tail -n 1 | cut -d ' ' -f 3` > /dev/null")
else
pingok = os.execute("ping -q -w 3 -c 2 `ip r | grep default | tail -n 1 | cut -d ' ' -f 3` > /dev/null")