add nc checks to agent
@@ -168,8 +168,8 @@ runcmd:
- echo `date`,`hostname`, startruncmd>>/opt/m
# the first arg is the number of retries, the second arg is the wait duration between two retries and the rest of the args are the cmd to run
- retrycmd_if_failure() { retries=$1; wait=$2; shift && shift; for i in $(seq 1 $retries); do ${@}; [ $? -eq 0 ] && break || sleep $wait; done; echo Executed \"$@\" $i times; }
-- retrycmd_if_failure 120 1 nc -zw1 $(grep nameserver /etc/resolv.conf | cut -d \ -f 2) 53
-- retrycmd_if_failure 120 1 nc -zw1 azure.com 443
+- retrycmd_if_failure 120 1 nc -zuw1 $(grep nameserver /etc/resolv.conf | cut -d \ -f 2) 53
+- retrycmd_if_failure 120 1 nc -zw1 aptdocker.azureedge.net 443
- apt-mark hold walinuxagent{{GetKubernetesAgentPreprovisionYaml .}}
- echo `date`,`hostname`, preaptupdate>>/opt/m
- retrycmd_if_failure 5 10 apt-get update
