I want to execute a shell script at the startup of the router.
and the test.sh file
#Check WAN Connection
echo "running test.sh" > /tmp/test.txt
But I don't have any file in the /tmp/ folder
Adding a a similar echo "running rc.local" > /tmp/rclocal.txt line to the rc.local generates the file successfully, so this means rc.local is executed, but my script is not.
How can I solve this?
Also ensure that you
chmod +x /etc/init.d/test.sh to make it executable.
Alright, I tried what is mentioned above. Still nothing. I made sure both rc.local and test.sh are executable..but the file is not there!
I don't have this in my rc.local file. If adding a period doesn't work, I'd try removing that instead.
Sorry to tell you that, but still nothing
echo "logger -t rc-local test-log" > /etc/rc.local
logread -e rc-local
Generally, backgrounding without daemonizing in an init script is problematic.
It finally worked...Seems the Notepad++ ASCII bytes are different than that of the internal editor or WINSCP...
Everything is tight. Thanks for all the help!
Doing something like this, too, rather often, and having had bad experience with it recently, can you explain, why it is problematic ?
Parent process and file descriptors vanish
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.