fixed minor bugs in demo scripts and run_stem
[urisagit/Stem.git] / bin / chat_demo
index 8437913..435af50 100755 (executable)
@@ -7,6 +7,13 @@ $xskip = ( $^O eq 'solaris' ) ? 600 : 500 ;
 
 print "CHAT DEMO\n" ;
 
+use File::Basename qw( basename );
+$ENV{PATH} .= ':' . basename( $0 ) . ':.';
+for my $prog qw( run_stem xterm telnet ) {
+    die "Can't find $prog in PATH\n" if
+        system( "which $prog >/dev/null 2>&1" ) != 0;
+}
+
 my @children ;
 
 $SIG{ 'INT' } = \&cleanup ;
@@ -42,13 +49,11 @@ print "$cmd\n" ;
        sleep 4 unless $cmd =~ /localhost/ ;
 }
 
+1 while wait() != -1;
 
-while( <STDIN> ) {
+exit;
 
-       next unless /^q/i ;
 
-       cleanup() ;
-}
 
 sub cleanup {