diff --git a/files/initrd/opt/arc/arc-functions.sh b/files/initrd/opt/arc/arc-functions.sh index a1e47634..d5528c02 100755 --- a/files/initrd/opt/arc/arc-functions.sh +++ b/files/initrd/opt/arc/arc-functions.sh @@ -693,26 +693,27 @@ function arcDNSMenu() { CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" if [ "${CONFDONE}" == "true" ]; then while true; do - ARCDNS="$(readConfigKey "arc.dns" "${USER_CONFIG_FILE}")" - MSG="Register your Subdomain at arcdns.tech\n" - MSG+="Enter the Values from ArcDNS below:\n" - dialog --backtitle "$(backtitle)" --title "Add DSM User" \ - --form "${MSG}" 8 60 3 "Domain:" 1 1 "domain" 1 10 50 0 "Token:" 2 1 "token" 2 10 50 0 \ - 2>"${TMP_PATH}/resp" - [ $? -ne 0 ] && return - domain="$(cat "${TMP_PATH}/resp" | sed -n '1p')" - token="$(cat "${TMP_PATH}/resp" | sed -n '2p')" - if [ -z "${domain}" ] || [ -z "${token}" ]; then - dialog --backtitle "$(backtitle)" --title "ArcDNS" \ - --msgbox "Invalid Domain or Token, retry!" 0 0 - continue - else - ARCDNS="https://arcdns.tech/update/${domain}/${token}" - dialog --backtitle "$(backtitle)" --colors --title "ArcDNS" \ - --msgbox "ArcDNS set successful!" 0 0 - fi + ARCDNS="$(readConfigKey "arc.dns" "${USER_CONFIG_FILE}")" + MSG="Register your Subdomain at arcdns.tech\n" + MSG+="Enter the Values from ArcDNS below:\n" + dialog --backtitle "$(backtitle)" --title "Add DSM User" \ + --form "${MSG}" 8 60 3 "Domain:" 1 1 "domain" 1 10 50 0 "Token:" 2 1 "token" 2 10 50 0 \ + 2>"${TMP_PATH}/resp" + [ $? -ne 0 ] && break + domain="$(cat "${TMP_PATH}/resp" | sed -n '1p')" + token="$(cat "${TMP_PATH}/resp" | sed -n '2p')" + if [ -z "${domain}" ] || [ -z "${token}" ]; then + dialog --backtitle "$(backtitle)" --title "ArcDNS" \ + --infobox "Invalid Domain or Token, retry!" 0 0 + sleep 3 + continue + else + ARCDNS="https://arcdns.tech/update/${domain}/${token}" + dialog --backtitle "$(backtitle)" --colors --title "ArcDNS" \ + --msgbox "ArcDNS set successful!" 0 0 writeConfigKey "arc.dns" "${ARCDNS}" "${USER_CONFIG_FILE}" break + fi done writeConfigKey "arc.builddone" "false" "${USER_CONFIG_FILE}" BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"