Skip to content

Commit

Permalink
Add: better way to restart cell network
Browse files Browse the repository at this point in the history
  • Loading branch information
wang701 committed Mar 6, 2019
1 parent d35f9b3 commit 1e745e8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions misc/get_pgns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
curl -o /opt/tmp_pgns http://cloudradio39.ecn.purdue.edu/pgns -m 30 > /dev/null 2>&1

if [ $? != 0 ]; then
echo 'curl failed, check network status'
udevadm trigger && echo 'try retriggering udev to setup Internet ...'
echo 'curl failed, check network status!'
PROCESS_NUM=$(ps -ef | grep "dhclient" | grep -v "grep" | wc -l)
if [ $PROCESS_NUM -eq 0 ]; then
echo 'network is down, and no dhclient running ... will try restarting the cell network'
qmicli -p -d /dev/cdc-wdm0 --wds-start-network=Broadband --client-no-release-cid
dhclient wwan0
fi
exit 1
fi

Expand Down

0 comments on commit 1e745e8

Please sign in to comment.