Add in auto_close functionality

Set whether terminal windows close after given numnber of seconds or wait until input given into terminal windows
This commit is contained in:
Duncan Ferguson 2011-11-24 21:48:35 +00:00
parent 23483ce362
commit 2b7ec74e6a
4 changed files with 28 additions and 5 deletions

View file

@ -25,6 +25,9 @@ sub script {
my $comms = $config->{comms};
my $comms_args = $config->{$comms.'_args'};
my $command = $config->{command};
my $autoclose = $config->{auto_close};
my $postcommand = $autoclose ? "echo Press RETURN to continue; read IGNORE" : "sleep $autoclose";
# # P = pipe file
# # s = server
@ -116,7 +119,7 @@ sub script {
\$command .= "\$svr";
}
}
\$command .= " $command || sleep 5";
\$command .= " $command ; $postcommand";
warn("Running:\$command\\n"); # for debug purposes
exec(\$command);
HERE