> The only way I can think of is having a script monitor the optional
> STDOUT of mprime and then checking whether it needs to contact the
> server.
I use the attached Tcl script to keep the last 25 lines of the output of mprime
in a file. You could put some commands in your crontab to check this file for
"done" and "server", and if it has "server" but not "done", connect to the Net,
but if it has "done", disconnect.
phma
#!/usr/bin/tclsh
# Reads standard input and writes the last n lines to a file.
# Usage: runtail n file
proc outem {} {
global n ;
global file;
global line ;
set f [open $file w];
for {set i 0} {$i < $n} {incr i} {puts $f $line($i)};
close $f;
}
proc scroll {str} {
global n;
global line;
for {set i 1} {$i < $n} {incr i} {set line([expr $i - 1]) $line($i)};
set line([expr $n - 1]) $str;
}
foreach {n file} $argv {}
for {set i 0} {$i < $n} {incr i} {set line($i) ""}
while {1} {
scroll [gets stdin];
outem;
}