Files
MIXBOX-ARCHIVE/apps/zerotier/config/mixbox.conf
2020-03-05 00:08:40 +08:00

29 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#------------------【ZeroTier】--------------------
zerotier() {
eval `mbdb export zerotier`
source /etc/mixbox/bin/base
uciset="mbdb set $appname.main"
echo "********* $service ***********"
echo "[${appinfo}][需要Entware环境]"
[ -z "$(mbdb show entware)" ] && echo "请先安装Entware插件" && return
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
echo "请在这里注册并获取网络ID[https://my.zerotier.com]"
echo "参考教程[http://www.right.com.cn/forum/thread-249161-1-1.html]"
[ -z "$networkid" ] && networkid="空"
read -p "修改${appname}网络ID($networkid)" res
if [ "$res" == '1' ]; then
read -p "请输入网络ID" res
[ -n "$res" ] && mbdb set $appname.main.networkid="$res"
fi
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
else
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
fi
}
#------------------【ZeroTier】--------------------