[fix] NetworkManager:isConnected() exit code check (#3795)

Fixes #3794.
pull/3799/head
Frans de Jonge 6 years ago committed by GitHub
parent dfd87447da
commit 680b53e347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -94,7 +94,7 @@ function NetworkMgr:isConnected()
return self:isWifiOn()
else
-- `-c1` try only once; `-w2` wait 2 seconds
return os.execute([[ping -c1 -w2 $(/sbin/route -n | awk '$4 == "UG" {print $2}')]])
return 0 == os.execute([[ping -c1 -w2 $(/sbin/route -n | awk '$4 == "UG" {print $2}')]])
end
end

Loading…
Cancel
Save