From bbe481a7fa159db107c7005f8b024bf4657c0bd6 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 4 Dec 2014 14:34:24 +0100 Subject: Backend for checking uptime --- isup/ping.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 isup/ping.php (limited to 'isup/ping.php') diff --git a/isup/ping.php b/isup/ping.php new file mode 100644 index 0000000..4c1bea7 --- /dev/null +++ b/isup/ping.php @@ -0,0 +1,26 @@ + /dev/null 2>&1", $ret); + + if ( $ret != 0 ) + return false; + + return true; +} + +function sanitizeHost($host){ + + if ( preg_match("|^[a-zA-Z]+://|", $host, $match) ) + $host = str_replace($match[0], "", $host); + if ( preg_match("|(?/.*)|", $host, $match) ) + $host = str_replace($match["query"], "", $host); + + return escapeshellarg($host); +} -- cgit v1.2.3