i just got interested in OpenWRT and want to try somethings.
i'm trying to run a script right after my OpenWRT boots. here is my script file
customchain.sh
#!/bin/sh /etc/rc.common
START=99
start(){
[my custom chains]
}
i've placed this script file at /etc/init.d
i wonder why this won't work.
if i check at /etc/rc.d, i can see S99customchain.sh -> ../init.d/customchain.sh
when i manually restart script file at root directory with
/etc/init.d/customchain.sh
i can see it applies well when i check via iptables -L
but as i said, this won't automatically starts when i (re)boot my OpenWRT system.
authority is already given by using +x
i've already tried using /etc/init.d/customchain enable and still doesn't work.
also i already checked similar question at here, and it doesn't have any answers.
what should i do?
1st approach: Add commands to
/etc/rc.localinside rc.local:
2nd approach: edit your crontab
add this line:
The script will run when the computer starts up.