浏览代码

test code for pulling cert info with jq

master
HMSheets 3 年前
父节点
当前提交
00635737ff
共有 1 个文件被更改,包括 40 次插入0 次删除
  1. +40
    -0
      update-NebulaNodeCert

+ 40
- 0
update-NebulaNodeCert 查看文件

@@ -0,0 +1,40 @@
#!/bin/bash

POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"

case $key in
-c|--certpath)
CERTPATH="$2"
shift # past argument
shift # past value
;;
-n|--newcertname)
NEWCERTNAME="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters

#if [[ -n $1 ]]; then
# echo "Invalid Parameter(s) Entered: $1"
# exit
#fi

#if [[ -n ${IPADDRESS} ]]; then
# echo "IP Address = ${IPADDRESS}"
#fi

NODENAME = ./nebula-cert print -path ${CERTPATH} -json | jq -s .[].details.name
NODEIPS = ./nebula-cert print -path ${CERTPATH} -json | jq -s .[].details.ips

echo "Node Name: ${NODENAME}"
echo "Node IPs: ${NODEIPS}"

正在加载...
取消
保存