Small optimization in network check for plugins

This commit is contained in:
bergware
2017-06-20 20:27:12 +02:00
parent 718e4baa7e
commit e768ba4603

View File

@@ -26,7 +26,7 @@ function check_plugin($arg, $google='8.8.8.8') {
while (1) {
if (exec("ping -qnc1 $google|awk '/received/{print $4}'")==1) break;
$inet--;
if ($inet) sleep(1); else break;
if (!$inet) break;
}
return $inet ? plugin('check',$arg) : false;
}