From 809a1539a3d83d0ea6f277519e6d43e75ccf1013 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Tue, 3 Jun 2014 15:11:43 -0400 Subject: [PATCH] lxc-download: Attempt to get the GPG key 3 times MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is to deal with the GPG pool occasionaly yielding broken servers. Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- templates/lxc-download.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/lxc-download.in b/templates/lxc-download.in index a06c0a401..31e0d279f 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -116,8 +116,17 @@ gpg_setup() { mkdir -p "$DOWNLOAD_TEMP/gpg" chmod 700 "$DOWNLOAD_TEMP/gpg" export GNUPGHOME="$DOWNLOAD_TEMP/gpg" - if ! gpg --keyserver $DOWNLOAD_KEYSERVER \ + + success= + for i in $(seq 3); do + if gpg --keyserver $DOWNLOAD_KEYSERVER \ --recv-keys ${DOWNLOAD_KEYID} >/dev/null 2>&1; then + success=1 + break + fi + done + + if [ -z "$success" ]; then echo "ERROR: Unable to fetch GPG key from keyserver." exit 1 fi -- 2.47.2