Merge pull request #1161 from sofia-riese/patch-1

refactor(set_ddns): replace recursion with while loop
This commit is contained in:
juewuy
2026-01-20 09:36:58 +08:00
committed by GitHub

View File

@@ -33,6 +33,7 @@ EOF
} }
set_ddns() { set_ddns() {
while true; do
echo "-----------------------------------------------" echo "-----------------------------------------------"
read -r -p "请输入你的域名 > " str read -r -p "请输入你的域名 > " str
[ -z "$str" ] && domain="$domain" || domain="$str" [ -z "$str" ] && domain="$domain" || domain="$str"
@@ -58,9 +59,9 @@ set_ddns() {
read -r -p "确认添加?(1/0) > " res read -r -p "确认添加?(1/0) > " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
add_ddns add_ddns
else break
set_ddns
fi fi
done
} }
set_ddns_service() { set_ddns_service() {