diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-09-28 15:31:47 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-09-28 15:31:47 -0700 |
commit | 980d145f48a517c9ee939aec4c6d436d85ffe391 (patch) | |
tree | ea78b0d9f77447abb4854bdfb5b8b52c133a35fb | |
parent | 1773dca9dc100f726c5a9752d814c83e3a94fddf (diff) | |
download | infinitytier-980d145f48a517c9ee939aec4c6d436d85ffe391.tar.gz infinitytier-980d145f48a517c9ee939aec4c6d436d85ffe391.zip |
Entry point changes to wait for ZT startup, print banners, log output debug messages and trace to files.
-rw-r--r-- | docker-test/entrypoint.sh | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/docker-test/entrypoint.sh b/docker-test/entrypoint.sh index 8b8bebf4..255aa87d 100644 --- a/docker-test/entrypoint.sh +++ b/docker-test/entrypoint.sh @@ -1,6 +1,40 @@ #!/bin/bash -./zerotier-one -d -U -p9993 +export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin + +echo '***' +echo '*** ZeroTier Network Containers Preview' +echo '*** https://www.zerotier.com/' +echo '***' +echo '*** Starting ZeroTier network container host...' + +/zerotier-one -d -U -p9993 >>/zerotier-one.out 2>&1 + +echo '*** Waiting for initial identity generation...' + +while [ ! -s /var/lib/zerotier-one/identity.secret ]; do + sleep 0.5 +done + +cat /var/lib/zerotier-one/identity.public + +echo '*** Waiting for network configuration...' + +virtip4="" +while [ ! -s /var/lib/zerotier-one/networks.d/e5cd7a9e1c5311ab.conf ]; do + sleep 0.5 +done +while [ -z "$virtip4" ]; do + virtip4=`/zerotier-cli listnetworks | grep -F e5cd7a9e1c5311ab | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1` +done + +echo '***' +echo '*** Up and running at ' $virtip4 ' -- join network e5cd7a9e1c5311ab and try:' +echo '*** > ping ' $virtip4 +echo -n '*** > curl http://' +echo -n $virtip4 +echo '/' +echo '***' rm -rf /run/httpd/* /tmp/httpd* -exec intercept /usr/sbin/httpd -D FOREGROUND +exec intercept /usr/sbin/httpd -D FOREGROUND >>/apache.out 2>&1 |