mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-11-04 11:39:22 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			327 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			327 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
NAME="skynet"
 | 
						|
ADDRESSRANGE="10.71.0.0/16"
 | 
						|
 | 
						|
generate_post_json ()
 | 
						|
{
 | 
						|
  cat <<EOF
 | 
						|
{
 | 
						|
  "netid": "$NAME",
 | 
						|
  "addressrange": "$ADDRESSRANGE"
 | 
						|
}
 | 
						|
EOF
 | 
						|
}
 | 
						|
 | 
						|
POST_JSON=$(generate_post_json)
 | 
						|
 | 
						|
curl --max-time 5.0 -d "$POST_JSON" -H 'Content-Type: application/json' -H "authorization: Bearer secretkey" localhost:8081/api/networks
 |