-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
34 lines (26 loc) · 808 Bytes
/
run.sh
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
#!/bin/bash
### Written by Nilushan Costa
### Purpose - Configure variables and start the router dashboard
### Input - None
### Output - None
DEFAULT_GATEWAY_IP=
MAX_DOWNLOAD_SPEED=
MAX_UPLOAD_SPEED=
if [ -z $DEFAULT_GATEWAY_IP ]; then
echo "ERROR: DEFAULT_GATEWAY_IP not found! Please set the default gateway IP address"
exit 1
fi
if [ -z $MAX_DOWNLOAD_SPEED ]; then
echo "ERROR: MAX_DOWNLOAD_SPEED not found! Please set the maximum download speed"
exit 1
fi
if [ -z $MAX_UPLOAD_SPEED ]; then
echo "ERROR: MAX_UPLOAD_SPEED not found! Please set the maximum upload speed"
exit 1
fi
if [ $MAX_DOWNLOAD_SPEED -gt $MAX_UPLOAD_SPEED ]; then
yAxisMax=$MAX_DOWNLOAD_SPEED
else
yAxisMax=$MAX_UPLOAD_SPEED
fi
`which node` ./getSpeeds.js $DEFAULT_GATEWAY_IP | `which python3` ./plotGraph.py $yAxisMax