diff --git a/nomad_smartrestart.sh b/nomad_smartrestart.sh index f3e5d7d..4959066 100755 --- a/nomad_smartrestart.sh +++ b/nomad_smartrestart.sh @@ -19,7 +19,7 @@ if [[ -z "${NO_COLOR}" ]]; then fi help() { - echo "nomad_smartrestart, v0.1 + echo -e "nomad_smartrestart, v0.1 By Starbeamrainbowlabs ${FBLE}${HC}USAGE${RS} @@ -30,19 +30,21 @@ ${FBLE}${HC}ENVIRONMENT VARIABLES${RS} } log_msg() { - echo "${HC}>>> nomad_smartrestart: ${RS}$*" >&2; + echo -e "${HC}>>> nomad_smartrestart: ${RS}$*" >&2; } log_error() { - echo "${HC}>>> nomad_smartrestart: ${FRED}$*${RS}"; + echo -e "${HC}>>> nomad_smartrestart: ${FRED}$*${RS}"; } if [[ -z "${imagename}" ]]; then log_error "Error: No image name specified." >&2; + help; exit 1; fi if [[ ! -f "./images/${imagename}/nomad.txt" ]]; then log_msg "No nomad.txt present for ${HC}${FGRN}${imagename}${RS}, nothing to do"; + help exit 0; fi