您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

40 行
824 B

  1. #!/bin/bash
  2. POSITIONAL=()
  3. while [[ $# -gt 0 ]]
  4. do
  5. key="$1"
  6. case $key in
  7. -c|--certpath)
  8. CERTPATH="$2"
  9. shift # past argument
  10. shift # past value
  11. ;;
  12. -n|--newcertname)
  13. NEWCERTNAME="$2"
  14. shift # past argument
  15. shift # past value
  16. ;;
  17. *) # unknown option
  18. POSITIONAL+=("$1") # save it in an array for later
  19. shift # past argument
  20. ;;
  21. esac
  22. done
  23. set -- "${POSITIONAL[@]}" # restore positional parameters
  24. #if [[ -n $1 ]]; then
  25. # echo "Invalid Parameter(s) Entered: $1"
  26. # exit
  27. #fi
  28. #if [[ -n ${IPADDRESS} ]]; then
  29. # echo "IP Address = ${IPADDRESS}"
  30. #fi
  31. $NODENAME = ./nebula-cert print -path ${CERTPATH} -json | jq -s .[].details.name
  32. $NODEIPS = ./nebula-cert print -path ${CERTPATH} -json | jq -s .[].details.ips
  33. echo "Node Name: ${NODENAME}"
  34. echo "Node IPs: ${NODEIPS}"