mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 18:48:36 -07:00
Make sure identity.public exists and stays in sync, cleanup extra new in Node, and test script for local testnets.
This commit is contained in:
parent
918fc8884b
commit
9a34fde8a5
4 changed files with 49 additions and 14 deletions
31
root-topology/test/create-test-root-topology.sh
Executable file
31
root-topology/test/create-test-root-topology.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ ! -e ../mktopology ]; then
|
||||
echo 'Build ../mktopology first!'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 'Populating supernodes/* with all Docker test-supernode-* container IPs and identities...'
|
||||
|
||||
rm -rf supernodes
|
||||
mkdir supernodes
|
||||
|
||||
for cid in `docker ps -f 'name=test-supernode-*' -q`; do
|
||||
id=`docker exec $cid cat /var/lib/zerotier-one/identity.public`
|
||||
ztaddr=`echo $id | cut -d : -f 1`
|
||||
ip=`docker exec $cid ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`
|
||||
echo $cid $ztaddr $id $ip
|
||||
echo "id=$id" >supernodes/$ztaddr
|
||||
echo "udp=$ip/9993" >>supernodes/$ztaddr
|
||||
done
|
||||
|
||||
echo 'Creating test-root-topology...'
|
||||
|
||||
rm -f test-root-topology
|
||||
../mktopology >test-root-topology
|
||||
|
||||
echo 'Done!'
|
||||
echo
|
||||
cat test-root-topology
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue