Execute a script at startup
-
Is there a way to automatically execute a script when the Onion boot?
I placed a user.sh file with execution permissions in /overlay (as expected on WRT) but it seems to be ignored. What I'm missing?Thanks, Andrea
-
you can edit /etc/rc.local
-
I added a mailsend command to rc.local, and the email is not sent.
The exact same mailsend command works at a command line.
Just for a test, I created a script to blink the led, called the script from rc.local, and it works. That tells me rc.local is being started properly, but no response from mailsend.Debug thoughts:
- Does rc.local require sudo or the like to run things?
- Is there some process that is not awake yet when rc.local runs?
- Is the wifi not connected yet when rc.local runs?
- Does mailsend do any logging of errors?
-
@Stony-Smith I think it is because the Omega is not yet connected to Wifi when you scheduled the system to run the mailsend. Can you try creating a script that has a delay (i.e.
sleep 30
), and try to run that script fromrc.local
.Please let me know if that works.
-
@Boken-Lin said in Execute a script at startup:
Please let me know if that works.
for the records I want to let everyone know that this solved the problem for me. I created startup.sh that is called from /etc/rc.local and includes a line with sleep 20 and the script I want the Onion to run at startup.
thanks for the info,
gosch
-
@gosch pls. put [Resolved] in your posts title also...