mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-10 23:41:27 +00:00
添加插件LingMaxDns #243
This commit is contained in:
BIN
apps/lingmaxdns/bin/lingmaxdns_linux_aarch64
Normal file
BIN
apps/lingmaxdns/bin/lingmaxdns_linux_aarch64
Normal file
Binary file not shown.
BIN
apps/lingmaxdns/bin/lingmaxdns_linux_arm
Normal file
BIN
apps/lingmaxdns/bin/lingmaxdns_linux_arm
Normal file
Binary file not shown.
BIN
apps/lingmaxdns/bin/lingmaxdns_linux_mips
Normal file
BIN
apps/lingmaxdns/bin/lingmaxdns_linux_mips
Normal file
Binary file not shown.
8
apps/lingmaxdns/config/lingmaxdns.uci
Normal file
8
apps/lingmaxdns/config/lingmaxdns.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="LingMaxDNS"
|
||||
appname="lingmaxdns"
|
||||
needver="0.0.1"
|
||||
backupfiles=""
|
||||
supports="linux_aarch64,linux_arm,linux_mips"
|
||||
appinfo="DNS优化插件,类似SmartDNS"
|
||||
newinfo=""
|
||||
version="0.0.1"
|
||||
16
apps/lingmaxdns/scripts/config.sh
Normal file
16
apps/lingmaxdns/scripts/config.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
|
||||
eval `mbdb export lingmaxdns`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
echo "插件介绍:https://www.right.com.cn/forum/thread-8137820-1-1.html"
|
||||
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||
readsh "重启${appname}服务[1/0]" "res" "1"
|
||||
[ "$res" != '0' ] && exit 0
|
||||
fi
|
||||
exit 1
|
||||
69
apps/lingmaxdns/scripts/lingmaxdns.sh
Normal file
69
apps/lingmaxdns/scripts/lingmaxdns.sh
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
eval `mbdb export lingmaxdns`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
port="8287"
|
||||
|
||||
start() {
|
||||
|
||||
[ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
# cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
# Scripts Here
|
||||
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "${port}"
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname}
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!" && end
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
# logsh "【$service】" "请在浏览器打开地址:http://$lanip:$port"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
# close_port
|
||||
# remove_firewall_start
|
||||
iptables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "${port}"
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
# cru d "${appname}"
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set ${appname}.main.enable=0
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
if [ -n "$(pidof ${appname})" ]; then
|
||||
status="运行中|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set ${appname}.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user