diff --git a/misc/get_pgns.sh b/misc/get_pgns.sh index c2f665e..ae2b537 100755 --- a/misc/get_pgns.sh +++ b/misc/get_pgns.sh @@ -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