groupcreate.sh 327 B

123456789101112131415161718
  1. #!/bin/bash
  2. NAME="skynet"
  3. ADDRESSRANGE="10.71.0.0/16"
  4. generate_post_json ()
  5. {
  6. cat <<EOF
  7. {
  8. "netid": "$NAME",
  9. "addressrange": "$ADDRESSRANGE"
  10. }
  11. EOF
  12. }
  13. POST_JSON=$(generate_post_json)
  14. curl --max-time 5.0 -d "$POST_JSON" -H 'Content-Type: application/json' -H "authorization: Bearer secretkey" localhost:8081/api/networks