|
@@ -16,6 +16,11 @@ case $key in |
|
|
shift # past argument |
|
|
shift # past argument |
|
|
shift # past value |
|
|
shift # past value |
|
|
;; |
|
|
;; |
|
|
|
|
|
-o|--outpath) |
|
|
|
|
|
OUTPATH="$2" |
|
|
|
|
|
shift # past argument |
|
|
|
|
|
shift # past value |
|
|
|
|
|
;; |
|
|
*) # unknown option |
|
|
*) # unknown option |
|
|
POSITIONAL+=("$1") # save it in an array for later |
|
|
POSITIONAL+=("$1") # save it in an array for later |
|
|
shift # past argument |
|
|
shift # past argument |
|
@@ -35,7 +40,7 @@ NODENAME=$(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s .[].detail |
|
|
#### TO-DO #### |
|
|
#### TO-DO #### |
|
|
# Make NODEIPS an Array like NODEGROUPS |
|
|
# Make NODEIPS an Array like NODEGROUPS |
|
|
NODEIPS=$(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s --compact-output .[].details.ips | sed 's/[]["]//g') |
|
|
NODEIPS=$(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s --compact-output .[].details.ips | sed 's/[]["]//g') |
|
|
NODEGROUPS=($(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s --compact-output .[].details.groups | sed 's/[]["]//g' | sed 's/,/ /g')) |
|
|
|
|
|
|
|
|
NODEGROUPS=$(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s --compact-output .[].details.groups | sed 's/[]["]//g') # | sed 's/,/ /g')) |
|
|
CERTISCASTATUS=$(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s --compact-output .[].details.isCa) |
|
|
CERTISCASTATUS=$(${NEBULACERTBINPATH} print -path ${CERTPATH} -json | jq -s --compact-output .[].details.isCa) |
|
|
|
|
|
|
|
|
# Create new file name variable |
|
|
# Create new file name variable |
|
@@ -54,4 +59,6 @@ if [[ $CERTISCASTATUS == false ]]; then |
|
|
echo "Certificate isCa Status: ${CERTISCASTATUS}" |
|
|
echo "Certificate isCa Status: ${CERTISCASTATUS}" |
|
|
echo "DateTime: ${DATETIME}" |
|
|
echo "DateTime: ${DATETIME}" |
|
|
echo "NEWFILENAME: ${NEWFILENAME}" |
|
|
echo "NEWFILENAME: ${NEWFILENAME}" |
|
|
|
|
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
|
|
|
|
|
${NEBULACERTBINPATH} sign -groups ${NODEGROUPS[@]} -ip ${NODEIPS} -name ${NODENAME} -out-crt ${OUTPATH}/${NEWFILENAME}.crt -out-key ${OUTPATH}/${NEWFILENAME}.key |
|
|
fi |
|
|
fi |