Make arvdock abort with a nice error message if docker or curl can not
[arvados.git] / docker / arvdock
index 788c1b39d955a2d21dfb82b588638a2cf2808346..26eaba988cf53dfcc6af9339e7e2507805d6ad05 100755 (executable)
@@ -6,6 +6,8 @@ if [[ "$DOCKER" == "" ]]; then
     DOCKER=`which docker`
 fi
 
+CURL=`which curl`
+
 COMPUTE_COUNTER=0
 
 function usage {
@@ -312,7 +314,7 @@ EOF
         echo "******************************************************************"
         echo
     else
-        while ! curl -L -f http://workbench.dev.arvados >/dev/null 2>/dev/null ; do
+        while ! $CURL -L -f http://workbench.dev.arvados >/dev/null 2>/dev/null ; do
             echo "Waiting for Arvados to be ready."
             sleep 1
         done
@@ -464,6 +466,18 @@ function do_reset {
     done
 }
 
+if [ "$DOCKER" == '' ]
+then
+  echo "Docker not found. Please install it first."
+  exit 2
+fi
+
+if [ "$CURL" == '' ]
+then
+  echo "Curl not found. Please install it first."
+  exit 3
+fi
+
 if [ $# -lt 1 ]
 then
   usage