Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinging 1.1.1.1 and 8.8.8.8 as failover, for robustness and suppressing the output of the periodic ping #12

Merged
merged 1 commit into from
Aug 31, 2024
Merged
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 wwan_keep_alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def connect_data():
if not system_and_sleep("timeout 20 udhcpc -i wwan0"):
continue
sleep(10)
if not system_and_sleep("ping 8.8.8.8 -I wwan0 -c1 -W2"):
if not system_and_sleep("ping 8.8.8.8 -I wwan0 -c1 -W2") and not system_and_sleep("ping 1.1.1.1 -I wwan0 -c1 -W2"):
continue
logging.info("Connected Data!")
break
Expand Down Expand Up @@ -104,7 +104,7 @@ def handle_data():
count = 0
while count < 10:
sleep(1)
if system("ping -c 1 -I wwan0 1.1.1.1"):
if system("ping -c 1 -I wwan0 1.1.1.1 > /dev/null 2>&1") or system("ping -c 1 -I wwan0 8.8.8.8 > /dev/null 2>&1"):
count = 0
else:
count += 1
Expand Down
Loading