[ubuntu] Handle DNS error and errors in the child processes (#2146)

This commit is contained in:
Sergey Dolin
2020-12-02 13:47:01 +05:00
committed by GitHub
parent 906e2ab865
commit 7893bb54f3

View File

@@ -13,11 +13,10 @@ i=1
while [ \$i -le 30 ];do
err=\$(mktemp)
$real_tool "\$@" 2>\$err
result=\$?
cat \$err >&2
# no errors, continue
test \$result -eq 0 && break
# no errors, break the loop and continue normal flow
test -f \$err || break
cat \$err >&2
retry=false
@@ -30,6 +29,9 @@ while [ \$i -le 30 ];do
elif grep -q 'IPC connect call failed' \$err;then
# the delay should help with gpg-agent not ready
retry=true
elif grep -q 'Temporary failure in name resolution' \$err;then
# It looks like DNS is not updated with random generated hostname yet
retry=true
fi
rm \$err