Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/mupibox/check_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
def internet():
try:
response = requests.get("https://www.google.com", timeout=5)
print("true") if response.status_code == 200 else print("false")
print("online") if response.status_code == 200 else print("offline")
# return response.status_code == 200
except requests.RequestException:
print("false")
print("offline")
# return False

internet()
Expand Down
4 changes: 2 additions & 2 deletions scripts/mupibox/check_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi

while true
do
if ( $(/usr/bin/python3 /usr/local/bin/mupibox/check_network.py) == ${TRUESTATE} ); then
if [ $(/usr/bin/python3 /usr/local/bin/mupibox/check_network.py) == ${TRUESTATE} ]; then
ONLINESTATE=${TRUESTATE}
if [ "${ONLINESTATE}" != "${OLDSTATE}" ]; then
if [ ! -f ${ACTIVE_FILE} ]; then
Expand Down Expand Up @@ -145,4 +145,4 @@ do
OLDSTATE=${ONLINESTATE}

sleep 10
done
done