summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Breton <thibeauG@atc-it.fr>2016-06-15 14:36:26 +0200
committerCorentin Breton <thibeauG@atc-it.fr>2016-06-15 14:36:26 +0200
commit770a80f1db25a8436dd52a1407858632644c8583 (patch)
tree93d236031a12556a1af835b9d6d14896a3fa9138
parent8083fce15bb737fd3fdd9a36762fae76ea5cd8bf (diff)
downloadmy_old_personal_website-770a80f1db25a8436dd52a1407858632644c8583.tar.xz
my_old_personal_website-770a80f1db25a8436dd52a1407858632644c8583.zip
Ajout de couleur et de la gestion de tous les sites à avoir en retour
Diffstat (limited to '')
-rw-r--r--app.php86
1 files changed, 75 insertions, 11 deletions
diff --git a/app.php b/app.php
index 87f9483..e4c15df 100644
--- a/app.php
+++ b/app.php
@@ -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>