Teach rc.initial.ping at least a little bit about ipv6.
This commit is contained in:
parent
42db9f7bb8
commit
4264284ed5
|
@ -39,9 +39,14 @@
|
|||
echo "\nEnter a host name or IP address: ";
|
||||
|
||||
$pinghost = chop(fgets($fp));
|
||||
if ($pinghost) {
|
||||
if (is_ipaddrv4($pinghost) || is_hostname($pinghost)) {
|
||||
$command = "ping";
|
||||
} elseif (is_ipaddrv6($pinghost)) {
|
||||
$command = "ping6";
|
||||
}
|
||||
if ($command) {
|
||||
echo "\n";
|
||||
passthru("/sbin/ping -c 3 -n " . escapeshellarg($pinghost));
|
||||
passthru("/sbin/{$command} -c 3 -n " . escapeshellarg($pinghost));
|
||||
echo "\nPress ENTER to continue.\n";
|
||||
fgets($fp);
|
||||
}
|
||||
|
|
Reference in New Issue