Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#147733 - 09/03/2003 19:45 Delay using EXEC_ONCE
cushman
veteran

Registered: 21/01/2002
Posts: 1380
Loc: Erie, CO
I just thought that I would ask what the best way to do this is.

I have a need to execute a program AFTER the player is started. It seems that if you use the irattach binary to start up the IrDA stack BEFORE the player app starts, something in the player app interferes with the IrDA stack, and IrDA is flaky.

I have a shell script called start_empire that contains the following:

#!/bin/bash
echo "start_empire: sleeping for $1 seconds..."
/usr/local/bin/sleep $1
echo "start_empire: Starting Empire..."
/usr/local/bin/irattach /dev/ttyS2
/usr/local/bin/empire

I added a line in my config.ini that reads:
;@EXEC_ONCE /bin/bash -c "/usr/local/bin/start_empire 7 &"

This does the job. It seems like 7 seconds is the sweet spot (on my player) where it will wait from the EXEC_ONCE line to after the player has started. The timing has to be configurable by modifying a variable in config.ini, since it will be different on other players.

Is there a better/cleaner way to do this, or is the shell script the best way to get this done? Would a better way be to modify empire.c so it does the irattach only after waiting for X seconds?
_________________________
Mark Cushman

Top
#147734 - 09/03/2003 20:50 Re: Delay using EXEC_ONCE [Re: cushman]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
You could probably ask Mark Lord very nicely to make a new EXEC_AFTER_PLAYER or something since Hijack already watches for when the player has started to do other things. e.g. Restoring visuals when in car mode.

- Trevor

Top
#147735 - 09/03/2003 21:31 Re: Delay using EXEC_ONCE [Re: tman]
cushman
veteran

Registered: 21/01/2002
Posts: 1380
Loc: Erie, CO
How about it, Mark? Pretty please with Camalots on top!
_________________________
Mark Cushman

Top
#147736 - 10/03/2003 06:20 Re: Delay using EXEC_ONCE [Re: cushman]
revlmwest
addict

Registered: 05/06/2002
Posts: 497
Loc: Hartsville, South Carolina for...
Leave the Camelites out of this...
_________________________
Michael West

Top
#147737 - 10/03/2003 16:36 Re: Delay using EXEC_ONCE [Re: cushman]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Mmm.. but I already have two stacked racks of camalots!


Top
#147738 - 10/03/2003 17:06 Re: Delay using EXEC_ONCE [Re: mlord]
cushman
veteran

Registered: 21/01/2002
Posts: 1380
Loc: Erie, CO
Well then I guess there's no bribing you.

Do you aid climb? I have 7 Camalots and 4 TCU's and they have done the trick for me at the Red, the New, Seneca, Boulder, etc.
_________________________
Mark Cushman

Top
#147739 - 10/03/2003 18:46 Re: Delay using EXEC_ONCE [Re: revlmwest]
Ezekiel
pooh-bah

Registered: 25/08/2000
Posts: 2413
Loc: NH USA
What about Camel Regulars? Maybe some American Spirits (or Export A Lites for our northern brothers)?

-Z
_________________________
WWFSMD?

Top