<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://err404.numericore.com/en/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Err404 - Misc:tools:tinystatus.sh</title>
        <description></description>
        <link>https://err404.numericore.com/en/</link>
        <lastBuildDate>Tue, 21 Apr 2026 11:59:50 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://err404.numericore.com/en/_media/wiki/logo.png</url>
            <title>Err404</title>
            <link>https://err404.numericore.com/en/</link>
        </image>
        <item>
            <title>start</title>
            <link>https://err404.numericore.com/en/Misc/tools/tinystatus.sh/start</link>
            <description>
&lt;p&gt;
source d&amp;#039;inspiration: &lt;a href=&quot;https://github.com/bderenzo/tinystatus&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/bderenzo/tinystatus&quot;&gt;https://github.com/bderenzo/tinystatus&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
I modified Bderenzo&amp;#039;s tinystatus, by adding an indication of the number of days remaining before the certificate expires, and I also added a variable for periodic page reloading. 
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://err404.numericore.com/en/_media/Misc/tools/tinystatus.sh/tinystatus.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
fichier &lt;code&gt;tinystatus.sh&lt;/code&gt;:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# source https://github.com/bderenzo/tinystatus&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# MIT licence: https://github.com/bderenzo/tinystatus/tree/master?tab=MIT-1-ov-file#readme&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Configuration variables&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;TITLE&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;Tinystatus&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;HEADER&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;Global Status&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;CHECKS_FILE&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${1:-checks.csv}&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;INCIDENTS_FILE&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${2:-incidents.txt}&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;OUTAGE_RC&lt;/span&gt;=&lt;span class=&quot;kw2&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;TIMEOUT&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;USER_AGENT&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;User-Agent: Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;TMP_DIR&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(mktemp -d)&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;TMP_DIR_DEBUG&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;/tmp/tinystatus-debug&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;refresh_delay&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;60&amp;quot;&lt;/span&gt;
&amp;nbsp;
command_exists&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;command&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${1}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;null &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Error: &lt;span class=&quot;es3&quot;&gt;${1}&lt;/span&gt; missing. Please install it&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
get_element&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${2}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;col&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${1}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-F&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;&#039;,&#039;&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;{gsub(/^[ \t]+|[ \t]+$/, &amp;quot;&amp;quot;, $col); print $col}&#039;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
check&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;check&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${1}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;host&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${2}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${3}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;expected_rc&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${4}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${5}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;today&lt;/span&gt;=$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;date&lt;/span&gt; +&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;re2&quot;&gt;ipversion&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(echo &amp;quot;${check}&amp;quot; | grep -o &#039;[46]$&#039;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${check}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt;
        http&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;rc&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(curl -${ipversion}sSkLo /dev/null -H &amp;quot;${USER_AGENT}&amp;quot; -m &amp;quot;${TIMEOUT}&amp;quot; -w &amp;quot;%{http_code}&amp;quot; &amp;quot;${host}&amp;quot; 2&amp;gt; &amp;quot;${TMP_DIR}/${id}.ko.info&amp;quot;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;cert&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(curl ${host} -vI 2&amp;gt;&amp;amp;1 | grep &amp;quot;expire date&amp;quot;| tr -s &amp;quot; &amp;quot;| cut -d&amp;quot; &amp;quot; -f4-8)&lt;/span&gt;&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;date_exp&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(curl ${host} -vI 2&amp;gt;&amp;amp;1 | grep &amp;quot;expire date&amp;quot;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;date_cert&lt;/span&gt;=$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${cert}&lt;/span&gt;&amp;quot;&lt;/span&gt; +&lt;span class=&quot;st0&quot;&gt;&amp;quot;%s&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;delay_cert0&lt;/span&gt;=$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;date_cert - today&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;delay_cert&lt;/span&gt;=$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;delay_cert0 &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;86400&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$delay_cert&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ok.cert&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ko.info&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
                &lt;span class=&quot;kw2&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s,curl: ([0-9]*) ,,&#039;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ko.info&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
                &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Status code: &lt;span class=&quot;es3&quot;&gt;${rc}&lt;/span&gt;, expected: &lt;span class=&quot;es3&quot;&gt;${expected_rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ko.info&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;ping&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw2&quot;&gt;ping&lt;/span&gt; -&lt;span class=&quot;co1&quot;&gt;${ipversion}&lt;/span&gt;W &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TIMEOUT}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${host}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;null &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;rc&lt;/span&gt;=&lt;span class=&quot;re4&quot;&gt;$?&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${expected_rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;Host unreachable&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ko.info&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
        port&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;error&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(nc -${ipversion}w &amp;quot;${TIMEOUT}&amp;quot; -zv ${host} 2&amp;gt;&amp;amp;1)&lt;/span&gt;&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;re2&quot;&gt;rc&lt;/span&gt;=&lt;span class=&quot;re4&quot;&gt;$?&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${expected_rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${error}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s,nc: ,,&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ko.info&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#        cert*)&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#            rc=&amp;quot;$(curl ${host} -vI 2&amp;gt;&amp;amp;1 | grep &amp;quot;expire date&amp;quot; &amp;gt; &amp;quot;${TMP_DIR}/${id}.cert&amp;quot;)&amp;quot;;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;esac&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;#set -x&lt;/span&gt;
    &lt;span class=&quot;co0&quot;&gt;# verity status and write files&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; == &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${expected_rc}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${name}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ok&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#            rc=&amp;quot;$(curl ${host} -vI 2&amp;gt;&amp;amp;1 | grep &amp;quot;expire date&amp;quot; &amp;gt;&amp;gt; &amp;quot;${TMP_DIR}/${id}.ok&amp;quot;)&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${name}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;.ko&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#            rc=&amp;quot;$(curl ${host} -vI 2&amp;gt;&amp;amp;1 | grep &amp;quot;expire date&amp;quot; &amp;gt;&amp;gt; &amp;quot;${TMP_DIR}/${id}.ko&amp;quot;)&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#set +x&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Verify requirements&lt;/span&gt;
command_exists &lt;span class=&quot;st_h&quot;&gt;&#039;curl&#039;&lt;/span&gt;
command_exists &lt;span class=&quot;st_h&quot;&gt;&#039;nc&#039;&lt;/span&gt;
command_exists &lt;span class=&quot;st_h&quot;&gt;&#039;ping&#039;&lt;/span&gt;
command_exists &lt;span class=&quot;st_h&quot;&gt;&#039;grep&#039;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#mkdir -p &amp;quot;${TMP_DIR}&amp;quot; || exit 1&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Execute checks&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;IFS&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(printf &#039;\n&#039;)&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-r&lt;/span&gt; line; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;check&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(get_element 1 &amp;quot;${line}&amp;quot;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;code&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(get_element 2 &amp;quot;${line}&amp;quot;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(get_element 3 &amp;quot;${line}&amp;quot;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;re2&quot;&gt;host&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(get_element 4 &amp;quot;${line}&amp;quot;)&lt;/span&gt;&amp;quot;&lt;/span&gt;
    check &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${check}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${host}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${name}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${code}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${id}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;
    : $&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;id&lt;/span&gt;++&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${CHECKS_FILE}&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;wait&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;OUTAGES_COUNT&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es4&quot;&gt;$(ls &amp;quot;${TMP_DIR}/&amp;quot;*.ko | wc -l)&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#OUTAGES_COUNT=&amp;quot;0&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Generate HTML&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;&amp;lt;&amp;lt; EOF
&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;&amp;lt;meta name=&amp;quot;viewport&amp;quot; http-equiv=&amp;quot;refresh&amp;quot; content=&amp;quot;${refresh_delay}&amp;quot; content=&amp;quot;width=device-width, initial-scale=1, shrink-to-fit=no&amp;quot;&amp;gt;&amp;lt;title&amp;gt;${TITLE}&amp;lt;/title&amp;gt;&amp;lt;style&amp;gt;
body { font-family: segoe ui,Roboto,Oxygen-Sans,Ubuntu,Cantarell,helvetica neue,Verdana,sans-serif; }
h1 { margin-top: 3em; }
ul { padding: 0px; }
li { list-style: none; margin-bottom: 2px; padding: 5px; border-bottom: 1px solid #ddd;  }
.container { max-width: 80em; width: 100%; margin: 15px auto; }
.panel { text-align: center; padding: 10px; border: 0px; border-radius: 5px; }
.failed-bg  { color: white; background-color: #E25D6A; }
.success-bg { color: white; background-color: #52B86A; }
.failed  { color: #E25D6A; }
.success { color: #52B86A; }
.small { font-size: 80%; }
.status { float: right; }
&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div class=&#039;container&#039;&amp;gt;
&amp;lt;h1&amp;gt;${HEADER}&amp;lt;/h1&amp;gt;
EOF&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${OUTAGES_COUNT}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;ul&amp;gt;&amp;lt;li class=&#039;panel failed-bg&#039;&amp;gt;&lt;span class=&quot;es3&quot;&gt;${OUTAGES_COUNT}&lt;/span&gt; Outage(s)&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;ul&amp;gt;&amp;lt;li class=&#039;panel success-bg&#039;&amp;gt;All Systems Operational&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;&amp;lt;&amp;lt; EOF
&amp;lt;h1&amp;gt;Services&amp;lt;/h1&amp;gt;
(updated every ${refresh_delay}s)
&amp;lt;ul&amp;gt;
EOF&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;.ko; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${file}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;continue&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;li&amp;gt;&lt;span class=&quot;es4&quot;&gt;$(cat &amp;quot;${file}&amp;quot;)&lt;/span&gt; &amp;lt;span class=&#039;small failed&#039;&amp;gt;(&lt;span class=&quot;es4&quot;&gt;$(cat &amp;quot;${file}.info&amp;quot;)&lt;/span&gt;)&amp;lt;/span&amp;gt;&amp;lt;span class=&#039;status failed&#039;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;.ok; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${file}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;continue&lt;/span&gt;
      &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&lt;/span&gt;$&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${file}&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;gt;&lt;span class=&quot;es4&quot;&gt;$(cat &amp;quot;${file}&amp;quot;)&lt;/span&gt;&amp;lt;/a&amp;gt; &amp;lt;span class=&#039;status success&#039;&amp;gt;certificat expire in &lt;span class=&quot;es4&quot;&gt;$(cat &amp;quot;${file}.cert&amp;quot;)&lt;/span&gt; days&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;&amp;lt;&amp;lt; EOF
&amp;lt;/ul&amp;gt;
&amp;lt;p class=small&amp;gt; Last check: $(date +%FT_%T)&amp;lt;/p&amp;gt;
EOF&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${INCIDENTS_FILE}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;&amp;lt;h1&amp;gt;Incidents&amp;lt;/h1&amp;gt;&#039;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${INCIDENTS_FILE}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;s|^\(.*\)$|&amp;lt;p&amp;gt;\1&amp;lt;/p&amp;gt;|&#039;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${INCIDENTS_FILE}&lt;/span&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;&amp;lt;p&amp;gt;No incident reported yet ;)&amp;lt;/p&amp;gt;&#039;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;co2&quot;&gt;&amp;lt;&amp;lt;EOF
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
EOF&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Cleanup and exit&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${TMP_DIR}&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;null
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${OUTAGE_RC}&lt;/span&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es3&quot;&gt;${OUTAGES_COUNT}&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;fi&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
file example &lt;code&gt;check.csv&lt;/code&gt;:
&lt;/p&gt;
&lt;pre class=&quot;code csv&quot;&gt;http4,  200,  https://err404.numericore.com (IPv4),             https://err404.numericore.com
http6,  200,  https://err404.numericore.com (IPv6),             https://err404.numericore.com
http4,  200,  https://wow.err404.numericore.com (IPv4),         https://wow.err404.numericore.com
http6,  200,  https://wow.err404.numericore.com (IPv6),         https://wow.err404.numericore.com&lt;/pre&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 09 Jan 2026 09:56:57 +0000</pubDate>
        </item>
    </channel>
</rss>
