From 2cc1eb9d059e9debb0cc4c6e0867f5df9e7d1124 Mon Sep 17 00:00:00 2001 From: Michael <30936296+mtan93@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:36:02 +0000 Subject: [PATCH] Update zt-auth.sh --- zt-auth.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/zt-auth.sh b/zt-auth.sh index 47acd4f..7c9b4ae 100644 --- a/zt-auth.sh +++ b/zt-auth.sh @@ -23,16 +23,20 @@ # # ################################################################################################ - - -# First get your NodeID (some OS require sudo here) -NETID=[REPLACE WITH NET ID] # +# SET INFO +# +NETID=[REPLACE WITH NET ID] APIKEY=[REPLACE WITH API KEY] # +# +# MYID=$(zerotier-cli info | cut -d " " -f 3) DEVNAME=$(/usr/sbin/scutil --get ComputerName) -DEVDESC=Device authorised through Purple Script. -#Then call the API +DEVDESC="Device authorised through Purple Script." +# +# CALL API WITH INFO +# curl -H "Authorization: Bearer $APIKEY" -X POST -d '{"name":"$DEVNAME","description":"$DEVDESC","config":{"authorized":true}}' https://my.zerotier.com/api/network/$NETID/member/$MYID -curl -s -H "Authorization: Bearer $APIKEY" https://my.zerotier.com/api/network/$NETID/member/$MYID >> '~/.config.authorized' +curl -s -H "Authorization: Bearer $APIKEY" https://my.zerotier.com/api/network/$NETID/member/$MYID >> '~/.ztconfig.authorized' +#