1 Star 0 Fork 0

漂泊的雪/ZeroTierOne-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
entrypoint.sh.release 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
Erik Hollensbe 提交于 2021-06-01 12:30 . Fix issue requiring CAP_SYS_PTRACE
#!/bin/sh
grepzt() {
[ ! -n "$(cat /var/lib/zerotier-one/zerotier-one.pid)" -a -d "/proc/$(cat /var/lib/zerotier-one/zerotier-one.pid)" ]
return $?
}
mkztfile() {
file=$1
mode=$2
content=$3
mkdir -p /var/lib/zerotier-one
echo "$content" > "/var/lib/zerotier-one/$file"
chmod "$mode" "/var/lib/zerotier-one/$file"
}
if [ "x$ZEROTIER_API_SECRET" != "x" ]
then
mkztfile authtoken.secret 0600 "$ZEROTIER_API_SECRET"
fi
if [ "x$ZEROTIER_IDENTITY_PUBLIC" != "x" ]
then
mkztfile identity.public 0644 "$ZEROTIER_IDENTITY_PUBLIC"
fi
if [ "x$ZEROTIER_IDENTITY_SECRET" != "x" ]
then
mkztfile identity.secret 0600 "$ZEROTIER_IDENTITY_SECRET"
fi
mkztfile zerotier-one.port 0600 "9993"
killzerotier() {
echo "Killing zerotier"
kill $(cat /var/lib/zerotier-one/zerotier-one.pid)
exit 0
}
trap killzerotier INT TERM
echo "starting zerotier"
nohup /usr/sbin/zerotier-one &
while ! grepzt
do
echo "zerotier hasn't started, waiting a second"
sleep 1
done
echo "joining networks: $@"
for i in "$@"
do
echo "joining $i"
while ! zerotier-cli join "$i"
do
echo "joining $i failed; trying again in 1s"
sleep 1
done
done
sleep infinity
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wandering_snow/ZeroTierOne-1.git
git@gitee.com:wandering_snow/ZeroTierOne-1.git
wandering_snow
ZeroTierOne-1
ZeroTierOne-1
master

搜索帮助