Add freeze, frozen_shell, hcoop-kprop.
[clinton/scripts.git] / s3
diff --git a/s3 b/s3
index 9601162..6b36ed6 100755 (executable)
--- a/s3
+++ b/s3
@@ -6,7 +6,7 @@
 CURL=/home/mwolson_admin/bin/curl
 HMAC=$(dirname $0)/s3-hmac
 ATTEMPTS=7
-ATTEMPT_WAIT=10
+ATTEMPT_WAIT=1m
 
 # print a message and bail
 die() {
@@ -160,14 +160,18 @@ s3_curl() {
   headers[${#headers[@]}]="Date: ${date}"
   [[ ${md5} ]] && headers[${#headers[@]}]="Content-MD5: ${md5}"
   tries=0
-  while test $tries -lt $ATTEMPTS; do
-    tries=$(expr $tries + 1)
+  while true; do
     $CURL ${arg} "${inout}" ${stdopts} -K <(curl_headers "${headers[@]}") \
        "http://s3.amazonaws.com${bucket}${remote}"
     ret=$?
     test $ret -eq 0 && break; 
-    sleep $ATTEMPT_WAIT
-    echo "Retrying ..."
+    if test $tries -lt $ATTEMPTS; then
+        tries=$(expr $tries + 1)
+        echo "Retrying ..."
+        sleep $ATTEMPT_WAIT
+    else
+        break
+    fi
   done
   return $ret
 }