| 123456789101112131415161718192021222324252627 | #!/bin/shecho "[netclient] joining network"if [ -z "${SLEEP}" ]; then    SLEEP=10fiTOKEN_CMD=""if [ "$TOKEN" != "" ]; then    TOKEN_CMD="-t $TOKEN"fi/root/netclient join $TOKEN_CMD -daemon off -dnson no -udpholepunch noif [ $? -ne 0 ]; then { echo "Failed to join, quitting." ; exit 1; } fiecho "[netclient] Starting netclient checkin"# loop and call checkin -n allFAILCOUNT=0while [ 1 ]; do    # add logs to netclient.logs    /root/netclient checkin -n all    if [ $? -ne 0 ]; then FAILCOUNT=$((FAILCOUNT+1)) ; else FAILCOUNT=0; fi    if [ $FAILCOUNT -gt 2 ]; then { echo "Failing checkins frequently, restarting." ; exit 1; } fi    sleep $SLEEPdoneecho "[netclient] exiting"
 |