Optimized ping test for plugins

This commit is contained in:
bergware
2018-01-02 14:10:41 +01:00
parent d234f9bbdd
commit c8e3f6805b
@@ -22,7 +22,7 @@ function plugin($method, $arg = '') {
function check_plugin($arg, $google='8.8.8.8') {
// ping google DNS server first to ensure internet is present
$inet = exec("ping -qnc2 -i0.2 $google|awk '/received/{print $4}'");
$inet = exec("ping -qnl2 -c2 -W3 $google|awk '/received/{print $4}'");
return $inet ? plugin('check',$arg) : false;
}