Files
docker-install/verify-docker-install
T
Andrew Hsu 006a30aa83 execute verify-docker-install straight-up to use setopt
By executing `bash verify-docker-install`, the `bash -e` at the top of
the script is not honored. Should just execute the script straight-up
to use whatever `set` options are desired in the script.

Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-07-09 17:43:01 +00:00

30 lines
783 B
Bash
Executable File

#!/bin/bash -e
expected_version=$1
expected_gitcommit=$2
(
echo "Executing installation script!"
sh build/install.sh
)
docker_version=$(docker --version)
if [ $? -ne 0 ]; then
echo "ERROR: Did Docker get installed?"
exit 3
fi
installed_version=$(echo $docker_version | awk '{print$3}')
installed_gitcommit=$(echo $docker_version | awk '{print$5}')
echo $docker_version
echo -n "Checking if installed version '$installed_version' matches '$expected_version'... "
if [[ "$installed_version" =~ "$expected_version" ]]; then
echo "PASSED!"
else
echo "FAILED!"
exit 1
fi
echo -n "Checking if installed gitcommit '$installed_gitcommit' matches '$expected_gitcommit'... "
if [[ "$installed_gitcommit" =~ "$expected_gitcommit" ]]; then
echo "PASSED!"
else
echo "FAILED!"
exit 2
fi