-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.htsh
46 lines (46 loc) · 1.5 KB
/
index.htsh
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Star Trek vs Star Wars!</title>
<meta name = "viewport" content = "width=device-width, initial-scale = 1.0">
<meta name="author" content="Tino Schroeter">
<link rel="stylesheet" href="static/css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="shortcut icon" href="static/favicon.ico">
</head>
<?bash
if [[ "$vote" = "a" ]];then
c=$(cat /tmp/a)
a=$(( $c +1 ))
echo $a > /tmp/a
elif [[ "$vote" = "b" ]];then
c=$(cat /tmp/b)
b=$(( $c +1 ))
echo $b > /tmp/b
fi
?>
<body>
<div id="content-container">
<div id="content-container-center">
<h3>Star Trek vs Star Wars!</h3>
<p>Hostname: <?bash hostname ?></p>
<p><?bash uptime | sed 's/average//g' | sed 's/ 0 users, //g' ?></p>
<p>IP Adress: <?bash echo $HTTP_X_REAL_IP ?></p>
<form id="choice" name='form' method="POST" action="/">
<button id="a" type="submit" name="vote" class="a" value="a">Star Trek</button>
<button id="b" type="submit" name="vote" class="b" value="b">Star Wars</button>
</form>
<div id="tip">
<?bash
trek=$(cat /tmp/a) || trek=0
echo "Star Trek $trek votes<br>"
wars=$(cat /tmp/b) || wars=0
echo "Star Wars $wars votes<br>"
?>
</div>
</div>
</div>
</div>
</body>
</html>