This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-zerotierone/doc/ext/kubernetes/entrypoint.sh

21 lines
650 B
Bash
Raw Normal View History

2016-08-18 15:13:43 -07:00
#!/bin/bash
2016-08-17 17:43:34 -07:00
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'
2016-08-18 15:13:43 -07:00
dev=""
2016-08-17 17:43:34 -07:00
2016-08-17 17:52:19 -07:00
nwconf=$(ls *.conf)
nwid="${nwconf%.*}"
2016-08-17 18:03:34 -07:00
2016-08-18 15:13:43 -07:00
sleep 10
dev=$(cat /var/lib/zerotier-one/identity.public| cut -d ':' -f 1)
echo '*** Joining'
./zerotier-cli join "$nwid".conf
2016-08-17 18:33:49 -07:00
AUTHTOKEN=$(cat /var/lib/zerotier-one/authtoken.secret)
sed "s|\local_service_auth_token|${AUTHTOKEN}|" .zerotierCliSettings > /root/.zerotierCliSettings
2016-08-18 15:13:43 -07:00
echo '*** Authorizing'
./zerotier-cli net-auth @my.zerotier.com "$nwid" "$dev"
node server.js