File: ruptime.cgi

package info (click to toggle)
ruptime 1.8-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 312 kB
  • sloc: sh: 364; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

echo -e "Content-type: text/html\n\n";

cat << EOF
<style type="text/css"><!--
@font-face
{ font-family: agave;
  src: url('agave-r-autohinted.woff2') format("truetype"); }
a, :visited, :link { color: red; }
body,tt,pre {
font-family: agave, sans-serif;
}

.topright {
  position: absolute;
  top: 8px;
  right: 8px;
}

.bottomright {
  position: fixed;
  bottom: 8px;
  right: 8px;
}

:root {
  --text: #000;
  --bg: #fff;
}
body {
  background-color: var(--bg);
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #fff;
    --bg: #000;
  }
}
-->
</style>
EOF
echo "<tt>"
sel=$(echo $QUERY_STRING | sed "s,.*=,,")
for a in $(grep ruptime /usr/bin/ruptime  |head -1 |sed "s,.*in ,,;s,;.*,,"); do
    echo "<a href=?query=$a>$a</a>"
    if [ "$a" = "$sel" ]; then
	run=$a
    fi
done
cat << TOPRIGHT
<div class="topright">
<a href="?query=stats">stats</a>
</div>
TOPRIGHT
cat << BOTTOMRIGHT
<div class="bottomright">
<a href="https://github.com/alexmyczko/ruptime/"><img src="https://raw.githubusercontent.com/alexmyczko/ruptime/debian/.ruptime.png" height=16></a>
</div>
BOTTOMRIGHT
echo "<pre>"
$run
echo "<br>"