This commit is contained in:
@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# install the dropshell host agent on this computer.
|
||||
# (not for remote servers)
|
||||
|
||||
SCRIPT_DIR=$(dirname "$0")
|
||||
|
||||
echo "Installing dropshell host agent on this computer..."
|
||||
@ -22,27 +25,6 @@ _check_required_env_vars() {
|
||||
done
|
||||
}
|
||||
|
||||
# Checks if Docker is installed, running, and user has permission. Returns 1 on failure.
|
||||
_check_docker_installed() {
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "Docker is not installed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# check if docker daemon is running
|
||||
if ! docker info &> /dev/null; then
|
||||
echo "Docker daemon is not running"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# check if user has permission to run docker
|
||||
if ! docker run --rm hello-world &> /dev/null; then
|
||||
echo "User does not have permission to run docker"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function install_bb64() {
|
||||
# check curl installed
|
||||
@ -77,7 +59,5 @@ set +a
|
||||
_check_required_env_vars "AGENT_LOCAL_PATH"
|
||||
echo "Installing host agent into $AGENT_LOCAL_PATH"
|
||||
|
||||
_check_docker_installed || _die "Docker is required."
|
||||
|
||||
install_bb64
|
||||
|
||||
|
Reference in New Issue
Block a user