~xdavidwu/uptime-monitor

ad330b38bf65313ec1342aef95c442f969228f9a — xdavidwu 3 years ago 7a06e71
PingProbe: support ipv6
1 files changed, 16 insertions(+), 6 deletions(-)

M app/Probes/PingProbe.php
M app/Probes/PingProbe.php => app/Probes/PingProbe.php +16 -6
@@ 7,12 7,22 @@ class PingProbe extends CommandProbe
    public function __construct($host)
    {
        $this->host = $host;
        parent::__construct([
            'ping',
            '-c1',
            '-W1',
            $host
        ]);
        if (strpos($host, ':') === false) {
            parent::__construct([
                'ping',
                '-c1',
                '-W1',
                $host
            ]);
        } else {
            parent::__construct([
                'ping',
                '-6',
                '-c1',
                '-W1',
                $host
            ]);
        }
    }

    public function describe()