? Shell scripts on startup...

Posted by: rowitech

? Shell scripts on startup... - 22/10/2003 09:28

Hi,

I want to try a little bit of shell-scripting on the empeg.
So I started a small script like this:

/drive0/var/rowi.sh:
/bin/echo "popup 3 Hello world..." >/proc/empeg_notify

This works in shell (vi on empeg is so cool), but after adding
in the hijack section of the config.ini I don't see something at startup:

[hijack]
;@EXEC_ONCE /drive0/var/rowi.sh

Why? Is the displayserver started behind this section?
What is the best way to display something on the screen?
Is a cron available or does it eat up too much ressources?

Rolf
Posted by: wfaulk

Re: ? Shell scripts on startup... - 22/10/2003 09:33

At a guess, I'd say that the thing that starts up shell scripts at the command line isn't being invoked by hijack. Try changing your line to:

;@EXEC_ONCE /bin/sh /drive0/var/rowi.sh

(Also, to be pedantic, your shell's first line should be:

#!/bin/sh

but it doesn't really make a lot of difference here.)
Posted by: rowitech

Re: ? Shell scripts on startup... - 22/10/2003 11:01

Yes, I even tried #!/bin/sh as the first line, but this didn't solve the problem. Nevertheless it's usual to call an own shell at the first line.
With the /bin/sh /drive0/var/rowi.sh it works! Great!
But now I already use an own shell and personally I wouldn't recommend a #!/bin/sh at the first line. Do you agree?

Rolf
Posted by: wfaulk

Re: ? Shell scripts on startup... - 22/10/2003 11:06

It's traditional, but it doesn't really mean anything in this case for two reasons. First, you're not using it to tell the OS which shell to use since you're telling it directly. Second, there aren't really any other shells on the empeg to be used. But it's just a comment; it's not going to hurt anything other than to waste 10 bytes. Use it or not; it doesn't make any difference.
Posted by: rowitech

Re: ? Shell scripts on startup... - 22/10/2003 11:18

Ok, I'm using it in other scripts so I'm fine to use it here.
But now, I see that I need a sleep command. Do I have to compile it myself? I found some posts with "use /usr/local/bin/sleep" but without even /usr/local/bin there's no sleep. Any Links for a quick download?

EDIT: Found it now in the empire package, works, too.

Rolf