3 # Written by Curtis L. Olson, started December 2002
4 # Some code portions courtesy of Melchior FRANZ
6 # This file is in the Public Domain and comes with no warranty.
9 # ----------------------------------------------------------------------------
20 if ( $val eq "true" ) {
22 } elsif ( $val eq "false" ) {
24 } elsif ( $val eq "" ) {
33 my( $handle ) = shift;
35 &send( $handle, "get " . shift );
36 eof $handle and die "\nconnection closed by host";
39 /^-ERR (.*)/ and die "\nfgfs error: $1\n";
46 my( $handle ) = shift;
50 &send( $handle, "set $prop $value");
52 # eof $handle and die "\nconnection closed by host";
57 my( $handle ) = shift;
59 print $handle shift, "\015\012";
66 my( $timeout ) = (shift || 120);
70 if ($socket = IO::Socket::INET->new( Proto => 'tcp',
74 $socket->autoflush(1);
77 print "Attempting to connect to $host ... " . $timeout . "\n";
84 return 1; # make perl happy