From be8370dfe4a9a33ae20291da2c5bd4ff6d0d1a68 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 1 Feb 2019 19:39:06 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index b9017830..76f77fab 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -71,26 +71,26 @@ case "$1" in newsite) echo "NEWSITE" while [ $# -gt 0 ]; do - case "${1}" in + case "$1" in -site) NEW_SITE=${2} ;; -type) SITE_TYPE=${2} ;; -ssl) CREATE_SSL=${2} ;; -scheme) PROXYSCHEME=${2} ;; -host) PROXYHOST=${2} ;; -port) PROXYPORT=${2} ;; - :) + -*) echo "Invalid option: '${OPTARG}' requires an argument" 1>&2 echo "" echo -e "Usage: ${idsCL[Yellow]}nodemgmt newcert${idsCL[Default]} {" - width=36 - printf "%-${width}s: %s\n" " -site {FQDN address}" "(*required)" - printf "%-${width}s: %s\n" " -ssl {true or false}" "(defaults to true)" - printf "%-${width}s: %s\n" " -type {'local' or 'proxy'}" "(defaults to local)" - printf "%-${width}s: %s\n" " -scheme {http or https}" "(required if type set to proxy)" - printf "%-${width}s: %s\n" " -host {IP or FQDN}" "(required if type set to proxy)" - printf "%-${width}s: %s\n" " -port {host port}" "(required if type set to proxy)" + width=33 + printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)" + printf "%-${width}s- %s\n" " -ssl {true or false}" "(defaults to true)" + printf "%-${width}s- %s\n" " -type {'local' or 'proxy'}" "(defaults to local)" + printf "%-${width}s- %s\n" " -scheme {http or https}" "(required if type set to proxy)" + printf "%-${width}s- %s\n" " -host {IP or FQDN}" "(required if type set to proxy)" + printf "%-${width}s- %s\n" " -port {host port}" "(required if type set to proxy)" echo "}" - ;; + exit 1;; esac done echo "NEW_SITE - ${NEW_SITE}" @@ -193,21 +193,22 @@ case "$1" in echo -e "${idsCL[LightGreen]}The new site for '${idsCL[LightGreen]}${NEW_SITE}${idsCL[Default]}' has been created.${idsCL[Default]}" echo "" else - echo "missing proxy arguments" + echo "Missing proxy arguments" exit 1 fi else - echo "Missing parameters" + echo "Missing arguments" echo "" echo -e "Usage: ${idsCL[Yellow]}nodemgmt newcert${idsCL[Default]} {" - width=36 - printf "%-${width}s: %s\n" " -d {FQDN address}" "(*required)" - printf "%-${width}s: %s\n" " -s {true or false}" "(defaults to true)" - printf "%-${width}s: %s\n" " -t {'local' or 'proxy'}" "(defaults to local)" - printf "%-${width}s: %s\n" " -S {http or https}" "(required if type set to proxy)" - printf "%-${width}s: %s\n" " -H {IP or FQDN}" "(required if type set to proxy)" - printf "%-${width}s: %s\n" " -P {host port}" "(required if type set to proxy)" + width=33 + printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)" + printf "%-${width}s- %s\n" " -ssl {true or false}" "(defaults to true)" + printf "%-${width}s- %s\n" " -type {'local' or 'proxy'}" "(defaults to local)" + printf "%-${width}s- %s\n" " -scheme {http or https}" "(required if type set to proxy)" + printf "%-${width}s- %s\n" " -host {IP or FQDN}" "(required if type set to proxy)" + printf "%-${width}s- %s\n" " -port {host port}" "(required if type set to proxy)" echo "}" + exit 1;; fi exit 1 ;;