|
Posted by jammer on March 17, 2008, 3:56 pm
Please log in for more thread options On Mar 16, 9:10 pm, sandy_sayda...@yahoo.com wrote:
>
> > How do I make tftp fail if the host is bad?
>
> > my $rc = system( "/usr/bin/tftp bad$host < $tempFile 2>&1
>/dev/null" );
> > if ( $rc != 0 ) {
> > print "unable to tftp to '$host'\n";
> > exit 1;
> > } else {
> > print "success: $rc\n";
> > }
>
> Make sure the binary returns non-zero on failure. Try that command on
> the command line and do "echo $?" right after.
>
> -sandyhttp://myperlquiz.com/
It prints an error when run interactively.
tftp does run, it just can't find the host.
It returns 0 because it ran, didn't work but it ran. :-(
|