You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
817 B
23 lines
817 B
|
10 years ago
|
#!/bin/bash
|
||
|
|
|
||
|
10 years ago
|
echo '*** ZeroTier-Kubernetes self-auth test script'
|
||
|
|
chown -R daemon /var/lib/zerotier-one
|
||
|
|
chgrp -R daemon /var/lib/zerotier-one
|
||
|
|
su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
|
||
|
10 years ago
|
dev=""
|
||
|
10 years ago
|
nwconf=$(ls *.conf)
|
||
|
|
nwid="${nwconf%.*}"
|
||
|
10 years ago
|
|
||
|
10 years ago
|
sleep 10
|
||
|
|
dev=$(cat /var/lib/zerotier-one/identity.public| cut -d ':' -f 1)
|
||
|
|
|
||
|
|
echo '*** Joining'
|
||
|
|
./zerotier-cli join "$nwid".conf
|
||
|
10 years ago
|
# Fill out local service auth token
|
||
|
10 years ago
|
AUTHTOKEN=$(cat /var/lib/zerotier-one/authtoken.secret)
|
||
|
10 years ago
|
sed "s|\local_service_auth_token_replaced_automatically|${AUTHTOKEN}|" .zerotierCliSettings > /root/.zerotierCliSettings
|
||
|
10 years ago
|
echo '*** Authorizing'
|
||
|
|
./zerotier-cli net-auth @my.zerotier.com "$nwid" "$dev"
|
||
|
10 years ago
|
echo '*** Cleaning up' # Remove controller auth token
|
||
|
|
rm -rf .zerotierCliSettings /root/.zerotierCliSettings
|
||
|
10 years ago
|
node server.js
|