From bde0ce36d36aaae56e38b51aa012fd6eba5fb1e9 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 1 Feb 2019 19:16:10 -0600 Subject: [PATCH] Update test.sh --- test.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test.sh b/test.sh index 5f78170..2179a1e 100755 --- a/test.sh +++ b/test.sh @@ -18,8 +18,21 @@ fi -while [ $# -gt 0 ] -do - echo "$1" - shift +#while getopts ':d:t:s:S:H:P:' flag; do +while [ $# -gt 0 ]; do + case "${1}" in + -d) NEW_SITE=${2}; echo "NEW_SITE - ${NEW_SITE}" ;; + -t) SITE_TYPE=${2}; echo "SITE_TYPE - ${SITE_TYPE}" ;; + -s) CREATE_SSL=${2}; echo "CREATE_SSL - ${CREATE_SSL}" ;; + -S) PROXYSCHEME=${2}; echo "PROXYSCHEME - ${PROXYSCHEME}" ;; + -H) PROXYHOST=${2}; echo "PROXYHOST - ${PROXYHOST}" ;; + -P) PROXYPORT=${2}; echo "PROXYPORT - ${PROXYPORT}" ;; + -*) + echo "Invalid option: '${OPTARG}' requires an argument" 1>&2 + echo "" + echo -e "Usage: ${idsCL[Yellow]}nodemgmt newcert${idsCL[Default]} { ${idsCL[Yellow]}-site${idsCL[Default]} {domain address} | ${idsCL[Yellow]}-type${idsCL[Default]} {'local' or 'proxy'} | ${idsCL[ Yellow]}-ssl${idsCL[Default]} {true or false} | ${idsCL[Yellow]}certrenew${idsCL[Default]} | ${idsCL[ Yellow]}-proxy_scheme${idsCL[Default]} {http or https} | ${idsCL[ Yellow]}-proxy_host${idsCL[Default]} {IP or FQDN} | ${idsCL[ Yellow]}-proxy_port${idsCL[Default]} {host port} }" + exit 1;; + *) break;; + esac + shift done