summaryrefslogtreecommitdiff
path: root/app.php
blob: ad5e09e604e595c5396297aabd9fe9f4f339a851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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
    $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." <a href='https://".$url."'>".$url."</a></div>";
      } elseif (404==$retcode) {
        echo "<div class='bloc code404'><div id='code404'>UP</div> ".$retcode." <a href='https://".$url."'>".$url."</a></div>";
      } elseif (401==$retcode) {
        echo "<div class='bloc code401'><div id='code401'>UP</div> ".$retcode." <a href='https://".$url."'>".$url."</a></div>";
      } elseif (501==$retcode) {
        echo "<div class='bloc code501'><div id='code501'>UP</div> ".$retcode." <a href='https://".$url."'>".$url."</a></div>";
      } else {
        echo "<div class='bloc down'><div id='down'>DOWN</div> ".$retcode." <a href='https://".$url."'>".$url."</a></div>";
      }
    }
?>
</body>
</html>