Skip to content

Commit 3ea9b94

Browse files
committed
fix: dns diagnostics tool
1 parent 5975b92 commit 3ea9b94

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎system/cuos/dialog-maintenance.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,15 @@ diagnostics_ping() {
359359
valid_ipv4 "$tgt" || valid_hostname "$tgt" || { msg "Invalid IP address or hostname"; return 1; }
360360
api_stream_background "Ping" ping -c 4 -w 4 -W 1 "$tgt"
361361
}
362+
diagnostics_dns_request() {
363+
local hn="$1"
364+
timeout 2 getent ahosts "$hn" && echo DNS resolution successful. || echo DNS resolution failed.
365+
}
362366
diagnostics_dns() {
363367
local hn
364368
hn="$(input "Enter hostname to resolve:" "cuos.dev" "DNS Test" 9 60)" || return 1
365369
valid_hostname "$hn" || { msg "Invalid hostname"; return 1; }
366-
api_stream_background "DNS resolve" "timeout 2 getent ahosts $hn && echo DNS resolution successful. || echo DNS resolution failed."
370+
api_stream_background "DNS resolve" "diagnostics_dns_request" "$hn"
367371
}
368372

369373
check_password() {

0 commit comments

Comments
 (0)