From 87c4f22104ce72c044803b4d8d4e35ce532f5a06 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Tue, 26 Apr 2016 17:36:58 -0700 Subject: [PATCH] better name for prereq check --- launcher | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/launcher b/launcher index 44a3338..5eb03c6 100755 --- a/launcher +++ b/launcher @@ -9,10 +9,10 @@ usage () { echo " destroy: Stop and remove a container" echo " enter: Use nsenter to enter a container" echo " logs: Docker logs for container" - echo " setup: Create a configuration file" echo " bootstrap: Bootstrap a container for the config based on a template" echo " rebuild: Rebuild a container (destroy old, bootstrap, start new)" echo " cleanup: Remove all containers that have stopped for > 24 hours" + echo " setup: Create a new configuration file and bootstrap" echo echo "Options:" echo " --skip-prereqs Don't check launcher prerequisites" @@ -21,17 +21,18 @@ usage () { exit 1 } -[ $# -lt 2 ] && { - usage -} command=$1 config=$2 shift 2 user_args="" +[ $# -lt 2 ] && { + usage +} + while [ ${#} -gt 0 ]; do - case "${1}" in + case "$command" in --skip-prereqs) SKIP_PREREQ="1" @@ -133,7 +134,7 @@ install_docker() { exit 1 } -prereqs() { +check_prereqs() { if [ -z $docker_path ]; then install_docker @@ -164,13 +165,13 @@ prereqs() { test=($($docker_path --version)) # Get docker version string test=${test[2]//,/} # Get version alone and strip comma if exists - # At least minimum version + # At least minimum docker version if compare_version "${docker_min_version}" "${test}"; then echo "ERROR: Docker version ${test} not supported, please upgrade to at least ${docker_min_version}, or recommended ${docker_rec_version}" exit 1 fi - # Recommend best version + # Recommend newer docker version if compare_version "${docker_rec_version}" "${test}"; then echo "WARNING: Docker version ${test} deprecated, recommend upgrade to ${docker_rec_version} or newer." fi @@ -277,7 +278,7 @@ check_ports() { } if [ -z "$SKIP_PREREQS" ] ; then - prereqs + check_prereqs fi host_run() { -- 2.25.1