We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be85b36 commit 86b2feaCopy full SHA for 86b2fea
api.py
@@ -61,9 +61,11 @@ def turn(data):
61
62
# Bot status (STUB)
63
def status():
64
+ internet_status = subprocess.check_output(["./scripts/check_conn.sh"]).decode('utf-8').replace('\n', '')
65
+
66
return {
67
"status": "ok",
- "internetConnectivity": True,
68
+ "internetConnectivity": internet_status,
69
"temp": "40",
70
"uptime": "5h",
71
}
scripts/check_conn.sh
@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
3
+echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
4
5
+if [ $? -eq 0 ]; then
6
+ echo "true"
7
+else
8
+ echo "false"
9
+fi
0 commit comments