From cd95dcf89e817a736a6b9cea5864fdb95740ced3 Mon Sep 17 00:00:00 2001 From: hms Date: Wed, 3 Feb 2021 16:06:39 -0800 Subject: [PATCH] fixed variable naming and parameter removal --- update-NebulaNodeCert | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/update-NebulaNodeCert b/update-NebulaNodeCert index 58ceb3d..d2b9d29 100644 --- a/update-NebulaNodeCert +++ b/update-NebulaNodeCert @@ -6,13 +6,8 @@ do key="$1" case $key in - -c|--nodecertpath) - NODECERTPATH="$2" - shift # past argument - shift # past value - ;; - -b|--nebulacertbinpath) - NEBULACERTBINPATH="$2" + -c|--nodecertname) + NODECERTNAME="$2" shift # past argument shift # past value ;; @@ -36,10 +31,10 @@ fi DATETIME=$(date '+%Y%m%d-%H%M%S') -NODENAME=$(${ROOTPATH}/nebula-cert print -path ${NODECERTPATH} -json | jq -s .[].details.name | sed 's/["]//g') -NODEIPS=$(${ROOTPATH}/nebula-cert print -path ${NODECERTPATH} -json | jq -s --compact-output .[].details.ips | sed 's/[]["]//g') -NODEGROUPS=$(${ROOTPATH}/nebula-cert print -path ${NODECERTPATH} -json | jq -s --compact-output .[].details.groups | sed 's/[]["]//g') # | sed 's/,/ /g')) -CERTISCASTATUS=$(${ROOTPATH}/nebula-cert print -path ${NODECERTPATH} -json | jq -s --compact-output .[].details.isCa) +NODENAME=$(${ROOTPATH}/nebula-cert print -path ${ROOTPATH}/${NODECERTNAME} -json | jq -s .[].details.name | sed 's/["]//g') +NODEIPS=$(${ROOTPATH}/nebula-cert print -path ${ROOTPATH}/${NODECERTNAME} -json | jq -s --compact-output .[].details.ips | sed 's/[]["]//g') +NODEGROUPS=$(${ROOTPATH}/nebula-cert print -path ${ROOTPATH}/${NODECERTNAME} -json | jq -s --compact-output .[].details.groups | sed 's/[]["]//g') # | sed 's/,/ /g')) +CERTISCASTATUS=$(${ROOTPATH}/nebula-cert print -path ${ROOTPATH}/${NODECERTNAME} -json | jq -s --compact-output .[].details.isCa) # Create new file name variable NEWFILENAME="${NODENAME}_${DATETIME}"