Write this as the first line of your script:
#!/bin/sh /etc/rc.common
Include into your script the command:
START=30
STOP=80
boot() {
#your commands here
}
Copy your script into
/etc/init.d/ directory
Make it executable
chmod +x /etc/init.d/<your script>
Create a symlink in /etc/rc.d/
ls -lh /etc/rc.d | grep <your script>
Enable your script
/etc/init.d/<your script> enable
Check that your init script is enabled
/etc/init.d/<your script> enabled && echo on
If this command returns on, then you're all set.
If this command doesn't return anything, then your script isn't enabled.
Here's an example of a script that's enabled:
root@OpenWrt:~# /etc/init.d/system enabled && echo on
on
No comments:
Post a Comment