diff options
Diffstat (limited to 'app.php')
-rw-r--r-- | app.php | 86 |
1 files changed, 75 insertions, 11 deletions
@@ -1,14 +1,78 @@ +<!DOCTYPE html> +<html> +<head> + <title>Status</title> + <style type="text/css"> + .bloc{ + background-color: rgb(201, 201, 201); + margin-top: 10px; + margin-bottom: 10px; + } + #code200{ + background:#679403; + border-radius:15%; + height:15px; + border:2px solid #679403; + float: left; + margin-right: 5px; + } + #code404{ + background:#d7c90e; + border-radius:15%; + height:15px; + border:2px solid #d7c90e; + float: left; + margin-right: 5px; + } + #code401{ + background:#d7570e; + border-radius:15%; + height:15px; + border:2px solid #d7570e; + float: left; + margin-right: 5px; + } + #code501{ + background:#d7570e; + border-radius:15%; + height:15px; + border:2px solid #d7570e; + float: left; + margin-right: 5px; + } + #down{ + background:#d70e0e; + border-radius:15%; + height:15px; + border:2px solid #d70e0e; + float: left; + margin-right: 5px; + } + </style> +</head> +<body> <?php - $url = 'gogs.neodarz.ovh/img/favicon.png'; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_NOBODY, true); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_exec($ch); - $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if (200==$retcode || 404==$retcode) { - echo "yep".$retcode; - } else { - echo "nope !".$retcode; + $listurl = array("neodarz.ovh","gogs.neodarz.ovh","kb.neodarz.ovh","cal.neodarz.ovh","dl.neodarz.ovh","duniter.neodarz.ovh","flux.neodarz.ovh","git.neodarz.ovh","guik.neodarz.ovh","maltrail.neodarz.ovh","music.neodarz.ovh","pad.neodarz.ovh","plex.neodarz.ovh","radicale.neodarz.ovh","rmail.neodarz.ovh","sync.neodarz.ovh","vpn.neodarz.ovh","www.neodarz.ovh"); + + foreach ($listurl as $url) { + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_NOBODY, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_exec($ch); + $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + if (200==$retcode) { + echo "<div class='bloc code200'><div id='code200'>UP</div> ".$retcode." ".$url."</div>"; + } elseif (404==$retcode) { + echo "<div class='bloc code404'><div id='code404'>UP</div> ".$retcode." ".$url."</div>"; + } elseif (401==$retcode) { + echo "<div class='bloc code401'><div id='code401'>UP</div> ".$retcode." ".$url."</div>"; + } elseif (501==$retcode) { + echo "<div class='bloc code501'><div id='code501'>UP</div> ".$retcode." ".$url."</div>"; + } else { + echo "<div class='bloc down'><div id='down'>DOWN</div> ".$retcode." ".$url."</div>"; + } } ?> +</body> +</html> |