Wrap base64 usage for BOOTSTRAP_SALTSTACK_COM

Previous patch did not count file:// usage for curl that is used in
offline image.

PROD-36473

Change-Id: I5be3f73dc188d1bec874098b9d86aa7cd8a802de
diff --git a/bootstrap.sh b/bootstrap.sh
index bafb328..f611c68 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -446,14 +446,20 @@
 
     echo -e "\nInstalling salt master ...\n"
 
+  # vkhlyunev: Gerrit returns file only in base64 encode, but there are other places (like offline image)
+  # that uses common plain-text files - ugly "solution" below
     case $PLATFORM_FAMILY in
       debian)
           $SUDO apt-get install -y git
-          curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- -M ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null || true
+          ( curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d ) && (
+          curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- -M ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null ) || (
+          curl -L ${BOOTSTRAP_SALTSTACK_COM} | $SUDO sh -s -- -M ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null )
         ;;
       rhel)
           yum install -y git
-          curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- -M ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null || true
+          ( curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d ) && (
+          curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- -M ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null ) || (
+          curl -L ${BOOTSTRAP_SALTSTACK_COM} | $SUDO sh -s -- -M ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null )
         ;;
     esac
 
@@ -503,12 +509,18 @@
 
     echo -e "\nInstalling salt minion ...\n"
 
+    # vkhlyunev: Gerrit returns file only in base64 encode, but there are other places (like offline image)
+    # that uses common plain-text files - ugly "solution" below
     case $PLATFORM_FAMILY in
       debian)
-          curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null || true
+          ( curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d) && (
+            curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null ) || (
+            curl -L ${BOOTSTRAP_SALTSTACK_COM} | $SUDO sh -s -- ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null )
       ;;
       rhel)
-          curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null || true
+          ( curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d) && (
+            curl -L ${BOOTSTRAP_SALTSTACK_COM} | base64 -d | $SUDO sh -s -- ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null ) || (
+            curl -L ${BOOTSTRAP_SALTSTACK_COM} | $SUDO sh -s -- ${BOOTSTRAP_SALTSTACK_OPTS} &>/dev/null )
       ;;
     esac