From 10c96569f12fe1b408e0433d246e5adc6c526d41 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 21 Feb 2022 00:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E4=BA=92?= =?UTF-8?q?=E7=9B=B8ping=E7=9A=84bug'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 7 +++---- gen_world.sh | 6 +++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index 5f0b873..a11b9a8 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,7 +1,6 @@ #!/bin/sh imageName="zerotier-planet" -docker network create zerotier echo "清除原有内容" rm /opt/planet @@ -11,11 +10,11 @@ docker rmi $imageName echo "打包镜像" -docker build --network zerotier -t $imageName . +docker build --network host -t $imageName . echo "启动服务" for i in $(lsof -i:9993 -t);do kill -2 $i;done -docker run -d --network zerotier --name $imageName -p 3443:3443 -p 9993:9993 -p 9993:9993/udp --dns 223.5.5.5 --dns 223.6.6.6 --restart unless-stopped $imageName +docker run -d --network host --name $imageName -p 3443:3443 -p 9993:9993 -p 9993:9993/udp --restart unless-stopped $imageName sleep 10s echo "生成世界" @@ -23,4 +22,4 @@ docker exec -it $imageName sh /app/gen_world.sh docker cp $imageName:/opt/ZeroTierOne/attic/world/world.bin /opt/planet echo "------------------" -echo "现在已经配置好了,planet文件在/opt/planet, 客户端连接时需要替换该planet" \ No newline at end of file +echo "现在已经配置好了,planet文件在/opt/planet, 客户端连接时需要替换该planet" diff --git a/gen_world.sh b/gen_world.sh index d86e9ce..2b86f08 100644 --- a/gen_world.sh +++ b/gen_world.sh @@ -7,4 +7,8 @@ cd /var/lib/zerotier-one && zerotier-idtool genmoon moon.json && mkdir moons.d & # 生成世界 cd /opt/ZeroTierOne/attic/world/ sh build.sh -./mkworld \ No newline at end of file +sleep 5s +./mkworld + +ps -ef |grep 'zerotier-one -d' |grep -v grep |awk '{print $1}' |xargs kill -9 +zerotier-one -d \ No newline at end of file