함수 is ipmiping()


1 Bash[ | ]

Bash
Copy
PING_TIMEOUT=2
PING_HOST=8.8.8.8
IS_IPMIPING=`ipmiping -c1 -t$PING_TIMEOUT $PING_HOST | grep 'in time' | awk '{print $4}'`
echo $IS_IPMIPING
# 0

2 PHP[ | ]

  • Linux
PHP
Copy
function is_ipmiping($host, $timeout = 2) {
	return exec("ping -c1 -t$timeout $host | grep 'in time' | awk '{print $4}'");
}

3 같이 보기[ | ]