forked from softlab-ntua/bencherl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bencherlui
executable file
·51 lines (45 loc) · 1.28 KB
/
bencherlui
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
#!/bin/bash
# Controls the web server that serves the web interface of the benchmark suite.
usage()
{
cat << EOF
Usage: bencherlui [OPTION..]
Start or stop the web server that serves bencherl UI.
-h display this help and exit
-u start the web server that serves bencherl UI (change port in ui/bencherlui/boss.config)
-d stop the web server that serves bencherl UI
For complete documentation, go to ...
EOF
}
START=`date +%s`
while getopts ":udh" opt; do
case $opt in
h)
usage
exit 0
;;
u)
echo "Starting web server... The port can be changed in ui/bencherlui/boss.config."
cd ui/bencherlui
./init.sh start
echo "Web server started."
host=`hostname -f`
port=`cat boss.config | grep port | grep -v db_port | cut -d',' -f 2 | cut -d'}' -f1 |sed -e 's/^[ \t]*//'`
echo "Use your web browser and go to http://$host:$port."
echo "Use the following command to stop the web server:"
echo "./bencherlui -d"
exit 0
;;
d)
echo "Stopping web server..."
cd ui/bencherlui
./init.sh stop
echo "Web server stopped."
exit 0
;;
\?)
echo "Invalid option: -$OPTARG"
exit 1
;;
esac
done