mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-14 17:31:35 +00:00
2018-12-31
This commit is contained in:
BIN
apps/aliddns/bin/aliddns_darwin_x86_64
Normal file
BIN
apps/aliddns/bin/aliddns_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/aliddns/bin/aliddns_linux_arm
Normal file
BIN
apps/aliddns/bin/aliddns_linux_arm
Normal file
Binary file not shown.
BIN
apps/aliddns/bin/aliddns_linux_mips
Normal file
BIN
apps/aliddns/bin/aliddns_linux_mips
Normal file
Binary file not shown.
BIN
apps/aliddns/bin/aliddns_linux_x86_64
Normal file
BIN
apps/aliddns/bin/aliddns_linux_x86_64
Normal file
Binary file not shown.
7
apps/aliddns/config/aliddns.uci
Normal file
7
apps/aliddns/config/aliddns.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="AliDDNS"
|
||||
appname="aliddns"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="动态将你的路由器IP绑定到域名"
|
||||
newinfo=""
|
||||
version="0.0.2"
|
||||
28
apps/aliddns/config/mixbox.conf
Normal file
28
apps/aliddns/config/mixbox.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
#------------------【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】--------------------
|
||||
1
apps/aliddns/config/version.txt
Normal file
1
apps/aliddns/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.5
|
||||
68
apps/aliddns/scripts/aliddns.sh
Normal file
68
apps/aliddns/scripts/aliddns.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export aliddns`
|
||||
|
||||
start() {
|
||||
|
||||
# [ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
# Scripts Here
|
||||
# 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 [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
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 "$(cru l | grep ${appname})" ]; then
|
||||
status="更新域名:$domain|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