added showing date and time; added conveniences

master
Adriel Sand 2021-09-26 18:23:53 +03:00
parent ebe99294fb
commit 4ff784d4b4
4 changed files with 63 additions and 13 deletions

View File

@ -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

View File

@ -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
View File

@ -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>

View File

@ -14,7 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
VERSION="0.4"
TOKEN="2021660264:AAHAMctZcI0vP7vB_uto-vfUkiUDNABbQVo"
TOKEN="$(cat token)"
CHATS=(-1001541565264)
DEBUG=false
DRY_RUN=false