add zerotier

This commit is contained in:
2019-11-06 15:38:29 +08:00
parent 1f55dd1f28
commit 8658763a4c
2 changed files with 43 additions and 0 deletions

15
zerotier/main.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
if [ ! -e /dev/net/tun ]; then
echo 'FATAL: cannot start ZeroTier One in container: /dev/net/tun not present.'
exit 1
fi
exec "$@"
if ! [[ -z "${NETWORK_ID}" ]]; then
zerotier-cli join ${NETWORK_ID}
fi