mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 14:13:30 +00:00
improve zerotier boot speed
This commit is contained in:
parent
e6d5432d84
commit
9a12e03e17
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user