mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 18:19:14 -05:00
Optimized ping test for plugins
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user