improve zerotier boot speed

This commit is contained in:
coolsnowwolf 2018-10-15 02:18:00 +08:00
parent e6d5432d84
commit 9a12e03e17
3 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ LUCI_TITLE:=LuCI for Zerotier
LUCI_DEPENDS:=+zerotier
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=10
PKG_RELEASE:=11
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -81,11 +81,11 @@ start_instance() {
start_service() {
config_load 'zerotier'
config_foreach start_instance 'zerotier'
nohup /etc/zerotier.start >> /tmp/zero.log 2>&1 &
touch /tmp/zero.log && nohup /etc/zerotier.start > /tmp/zero.log 2>&1 &
}
stop_instance() {
nohup /etc/zerotier.stop > /tmp/zero.log 2>&1 &
rm -f /tmp/zero.log
local cfg="$1"
# Remove existing link or folder

View File

@ -2,13 +2,15 @@
zero_enable=$(uci get zerotier.sample_config.enabled)
if [ ($zero_enable -eq 1) && (pgrep /usr/bin/zerotier-one >/dev/null) ]; then
if [ $zero_enable -eq 1 ]; then
if [ -f /tmp/zero.log ];then
while [ "$(ifconfig | grep zt | awk '{print $1}')" = "" ]
do
echo "zt interface not started yet, try build rules after 5s"
sleep 5
done
fi
nat_enable=$(uci get zerotier.sample_config.nat)
zt0=$(ifconfig | grep zt | awk '{print $1}')
@ -24,5 +26,3 @@ if [ $nat_enable -eq 1 ]; then
fi
fi