added showing date and time; added conveniences
parent
ebe99294fb
commit
4ff784d4b4
|
@ -3,14 +3,16 @@
|
|||
echo "Content-type: text/html"
|
||||
echo ""
|
||||
|
||||
date_now=$(date +'%b %d, %Y at %H:%M')
|
||||
|
||||
if [[ $(cat state.txt) = "ON" ]]
|
||||
then
|
||||
echo "OFF" > state.txt
|
||||
echo $(cat off.html) > /usr/local/apache2/htdocs/index.html
|
||||
cat off.html | sed "s/date-n-time-placeholder/$date_now" > /usr/local/apache2/htdocs/index.html
|
||||
./telegram "✅ The generator is OFF!"
|
||||
else
|
||||
echo "ON" > state.txt
|
||||
echo $(cat on.html) > /usr/local/apache2/htdocs/index.html
|
||||
cat on.html | sed "s/date-n-time-placeholder/$date_now" > /usr/local/apache2/htdocs/index.html
|
||||
./telegram "❌ The generator is on. :("
|
||||
fi
|
||||
|
||||
|
|
34
off.html
34
off.html
|
@ -20,7 +20,7 @@
|
|||
display: block;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
padding: 50px;
|
||||
padding: 50px 50px 10px 50px;
|
||||
}
|
||||
.status-bg-on {
|
||||
background-color: dimgray;
|
||||
|
@ -28,10 +28,11 @@
|
|||
display: block;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
padding: 50px;
|
||||
padding: 50px 50px 10px 50px;
|
||||
}
|
||||
.status-text {
|
||||
color: white;
|
||||
padding: 10px 5px;
|
||||
font-size: 40px;
|
||||
}
|
||||
.credits {
|
||||
|
@ -51,17 +52,40 @@
|
|||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
|
||||
.date-time-updated {
|
||||
padding: 5px 5px;
|
||||
color: #dddddd;
|
||||
text-align: center;
|
||||
}
|
||||
.date-time-updated b {
|
||||
color: #ffffff;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.nothidden {
|
||||
display: block
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="status-bg-off">
|
||||
<div class="status-bg-on hidden">
|
||||
<div class="status-text">
|
||||
<p>The generator is <b>ON</b> :(</p>
|
||||
</div>
|
||||
<div class="date-time-updated">
|
||||
<p>last updated at: <b>date-n-time-placeholder</b></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status-bg-off nothidden">
|
||||
<div class="status-text">
|
||||
<p>The generator is <b>OFF!</b> :)</p>
|
||||
</div>
|
||||
<div class="date-time-updated">
|
||||
<p>last updated at: <b>date-n-time-placeholder</b></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="credits">
|
||||
<p>Made with ❤️ | Source Code: <a href="https://git.sandcastle.eu.org/thebiblelover7/generator-status">Gitea</a>
|
||||
|
|
34
on.html
34
on.html
|
@ -20,7 +20,7 @@
|
|||
display: block;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
padding: 50px;
|
||||
padding: 50px 50px 10px 50px;
|
||||
}
|
||||
.status-bg-on {
|
||||
background-color: dimgray;
|
||||
|
@ -28,10 +28,11 @@
|
|||
display: block;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
padding: 50px;
|
||||
padding: 50px 50px 10px 50px;
|
||||
}
|
||||
.status-text {
|
||||
color: white;
|
||||
padding: 10px 5px;
|
||||
font-size: 40px;
|
||||
}
|
||||
.credits {
|
||||
|
@ -51,17 +52,40 @@
|
|||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
|
||||
.date-time-updated {
|
||||
padding: 5px 5px;
|
||||
color: #dddddd;
|
||||
text-align: center;
|
||||
}
|
||||
.date-time-updated b {
|
||||
color: #ffffff;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.nothidden {
|
||||
display: block
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="status-bg-on">
|
||||
<div class="status-bg-on nothidden">
|
||||
<div class="status-text">
|
||||
<p>The generator is <b>ON</b> :(</p>
|
||||
</div>
|
||||
<div class="date-time-updated">
|
||||
<p>last updated at: <b>date-n-time-placeholder</b></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status-bg-off hidden">
|
||||
<div class="status-text">
|
||||
<p>The generator is <b>OFF!</b> :)</p>
|
||||
</div>
|
||||
<div class="date-time-updated">
|
||||
<p>last updated at: <b>date-n-time-placeholder</b></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="credits">
|
||||
<p>Made with ❤️ | Source Code: <a href="https://git.sandcastle.eu.org/thebiblelover7/generator-status">Gitea</a>
|
||||
|
|
Loading…
Reference in New Issue