moxbox init

This commit is contained in:
monlor
2020-03-05 00:08:40 +08:00
commit 76dbe98978
856 changed files with 170708 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
#------------------【SmartDNS】--------------------
smartdns() {
eval `mbdb export smartdns`
source /etc/mixbox/bin/base
uciset="mbdb set $appname.main"
echo "********* $service ***********"
echo "[${appinfo}]"
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
readsh "请输入${appname}运行端口号" "port" "535"
echo "${appname}全部配置: "
[ -z "$(mbdb show ${appname}.info)" ] && echo "未添加配置!" || mbdb show ${appname}.info
read -p "是否要更改${appname}上游服务器配置?[1/0] " res
if [ "$res" == '1' ]; then
readsh "是否要使用工具箱内置的一些dns列表[百度、谷歌等]" "default_dns" "1"
read -p "添加${appname}上游服务器配置?[1/0] " res
if [ "$res" == '1' ]; then
while(true)
do
read -p "请输入${appname}的上游DNS服务器名称: " name
read -p "请输入${appname}的上游DNS服务器地址: " url
read -p "请输入${appname}的上游DNS服务器端口(默认53): " port
read -p "${appname}的上游服务器是否使用tcp查询方式[1/0] " tcp
if [ -z "$name" -o -z "$url" ]; then
echo "配置不能为空,未添加!"
else
[ -z "${port}" ] && port=53
if [ "$tcp" = '1' ]; then
mbdb set ${appname}.info.$name="server-tcp $url:${port}"
else
mbdb set ${appname}.info.$name="server $url:${port}"
fi
fi
echo "已添加配置[$name $url:${port}]"
read -p "继续添加配置?[1/0] " res
[ "$res" == '0' -o -z "$res" ] && break
done
fi
read -p "删除${appname}上游服务器配置?[1/0] " res
if [ "$res" == '1' ]; then
read -p "清空配置再添加?[1/0] " res
[ "$res" == '1' ] && mbdb clear ${appname}.info
echo "["$(mbdb keys ${appname}.info)"]"
while(true)
do
read -p "请输入要删除的配置名: " res
[ ! -z "$res" ] && mbdb del ${appname}.info.$res
read -p "继续删除配置?[1/0] " res
[ "$res" == '0' -o -z "$res" ] && break
done
fi
fi
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
else
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
fi
}
#------------------【SmartDNS】--------------------

View File

@@ -0,0 +1,54 @@
# dns server name, defaut is host name
# server-name,
# example:
server-name smartdns
#
# dns server bind ip and port, default dns server port is 53.
# bind [IP]:port,
# example:
# IPV4: :53
# IPV6 [::]:53
bind [::]:535
# dns cache size
# cache-size [number]
# 0: for no cache
cache-size 512
# prefetch domain
# prefetch-domain [true|false]
# prefetch-domain true
# ttl for all resource record
# rr-ttl: ttl for all record
# rr-ttl-min: minimum ttl for resource record
# rr-ttl-max: maximum ttl for resource record
# example:
# rr-ttl 300
# rr-ttl-min 60
# rr-ttl-max 86400
# set log level
# log-level [level], level=error, warn, info, debug
# log-size k,m,g
log-level error
# log-file /var/log/smartdns.log
# log-size 128k
# log-num 2
# remote udp dns server list
# server [IP]:[PORT], default port is 53
# server 8.8.8.8
# remote tcp dns server list
# server-tcp [IP]:[PORT], default port is 53
# server-tcp 8.8.8.8
# specific address to domain
# address /domain/ip
# address /www.example.com/1.2.3.4
# List of hosts that supply bogus NX domain results
# bogus-nxdomain [ip]

View File

@@ -0,0 +1,7 @@
service="SmartDNS"
appname="smartdns"
needver="0.0.1"
supports="linux_arm,linux_mips,linux_x86_64"
appinfo="DNS加速工具从多个上游DNS服务器查询避免DS污染"
newinfo="更新smartdns程序版本"
version="0.0.3"

View File

@@ -0,0 +1 @@
1.0.5