添加aliddns的ipv6支持

This commit is contained in:
monlor
2020-06-23 13:44:36 +08:00
parent d6b0af137e
commit 834a4772ca
12 changed files with 52 additions and 58 deletions

BIN
apps/aliddns/bin/aliddns_darwin_x86_64 Normal file → Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,5 +3,5 @@ appname="aliddns"
needver="0.0.1"
supports="linux_aarch64,linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
appinfo="动态将你的路由器IP绑定到域名"
newinfo=""
version="0.0.2"
newinfo="支持ipv6"
version="0.0.3"

View File

@@ -1,28 +0,0 @@
#------------------【AliDDNS】--------------------
aliddns() {
eval `mbdb export aliddns`
source /etc/mixbox/bin/base
echo "********* $service ***********"
echo "[${appinfo}]"
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
read -p "修改${appname}配置?[1/0] " res
if [ "$res" = '1' ]; then
readsh "请输入${appname}访问ID" "app_key"
readsh "请输入${appname}访问密钥" "app_secret"
readsh "请输入${appname}域名[例如@.mixbox.com或www.mixbox.com]" "domain"
readsh "请输入${appname}检查分钟间隔(建议10)" "time" "10"
fi
# read -p "更新DNS前先清除旧的DNS记录(默认不清除)[1/0] " res
# mbdb set $appname.main.clean="$res"
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
else
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
fi
}
#------------------【AliDDNS】--------------------

View File

@@ -1 +0,0 @@
1.0.5

View File

@@ -6,15 +6,18 @@ start() {
# [ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
logsh "$service" "正在启动${appname}服务... "
# Scripts Here
local extra_cmd=""
# open_port
# write_firewall_start
[ -z "$app_key" -o -z "$app_secret" -o -z "$domain" ] && logsh "$service" "访问ID或密钥或域名为空" && exit 1
[ -z "$time" ] && time=10
cru a "${appname}" "*/$time * * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
daemon ${mbroot}/apps/${appname}/bin/${appname} --id "$app_key" --secret "$app_secret" auto-update --domain "$domain"
if [ "${ipv6}" = '1' ]; then
extra_cmd="&& ${mbroot}/apps/${appname}/bin/${appname} --id "$app_key" --secret "$app_secret" auto-update -6 --domain "$domain""
fi
daemon ${mbroot}/apps/${appname}/bin/${appname} --id "$app_key" --secret "$app_secret" auto-update --domain "$domain" ${extra_cmd}
if [ $? -ne 0 ]; then
logsh "$service" "启动${appname}服务失败!"
else

View File

@@ -0,0 +1,24 @@
#!/bin/sh
#copyright by monlor
eval `mbdb export aliddns`
source "$(mbdb get mixbox.main.path)"/bin/base
echo "********* $service ***********"
echo "[${appinfo}]"
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
read -p "修改${appname}配置?[1/0] " res
if [ "$res" = '1' ]; then
readsh "请输入${appname}访问ID" "app_key"
readsh "请输入${appname}访问密钥" "app_secret"
readsh "请输入${appname}域名[例如@.mixbox.com或www.mixbox.com]" "domain"
readsh "请输入${appname}检查分钟间隔(建议10)" "time" "10"
fi
readsh "启用ipv6支持[1/0]" "ipv6" "0"
readsh "重启${appname}服务[1/0]" "res" "1"
[ "$res" != '0' ] && exit 0
fi
exit 1

View File

@@ -7,11 +7,11 @@ echo "********* $service ***********"
echo "[${appinfo}]"
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
readsh "请输入npc连接命令" "connect_cmd"
# Scripts Here
readsh "请输入npc连接命令" "connect_cmd"
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
readsh "重启${appname}服务[1/0] " "res" "1"
[ "$res" != '0' ] && exit 0
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
readsh "重启${appname}服务[1/0] " "res" "1"
[ "$res" != '0' ] && exit 0
fi
exit 1