]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-download: Attempt to get the GPG key 3 times
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 3 Jun 2014 19:11:43 +0000 (15:11 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 3 Jun 2014 19:52:43 +0000 (15:52 -0400)
This is to deal with the GPG pool occasionaly yielding broken servers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-download.in

index a06c0a401e98ef309d330ff8bc8a4bf665400f9e..31e0d279f49ba25257a66dcd0c48cead580be8c6 100644 (file)
@@ -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