On Thu, Apr 26, 2001 at 11:24:30AM +0200, Andre Berger wrote:
> I have a shell script in /etc/ppp/ip-up.d/ that synchronizes the system
> clock with time servers via rdate. Sometimes the servers can't be
> reached, and the rest of my scripts are blocked. Is there a way to say:
> "You have at most 10 seconds to complete this command, or fail"?
----
PROG=do-this
TIMEOUT=10
$PROG &
REAPER=$!
sleep $TIMEOUT
if [ "$( ps h -p $REAPER -o ucmd )" == "$PROG" ]; then
kill $REAPER
fi
----
not 100% failsafe, but close.
--
John Lenton (john@grulic.org.ar) -- Random fortune:
Al oír un eco muchos creen que el sonido proviene de él.
-- Ernest Hemingway.
Attachment:
pgpukZJErumcJ.pgp
Description: PGP signature