i have this command in my code: exec $lynx -preparsed -dump $radio(host)
if $radio(host) is down, lynx returns an error:
[18:26] Tcl error [radio:dataget]:
Looking up www.xxxx.com
Unable to locate remote host www.xxxx.com.
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://www.xxxx.com
how could I check if the host is up or not, so if it's down this procedure do not return a error?
proc radio:dataget { hand idx text } {
global lynx radio
set rfs "[open $radio(file) w]"
puts $rfs [exec $lynx -preparsed -dump http://www.xxxx.com:$radio(port)]
close $rfs
return 0
}