I defined the following script (it's called pcap):
#!/bin/sh /etc/rc.common
# Example script
# Copyright (C) 2007 OpenWrt.org
START=10
STOP=15
start() {
echo start
./delete_pcap
# commands to launch application
}
stop() {
echo stop
# commands to kill application
}
I put this script in the /etc/init.d folder. When I do /etc/init.d/pcap start
, the start function is executed and the delete_pcap (in C language, which is in the same /etc/init.d
folder) program is executed correctly. Anyway, if I do /etc/init.d/pcap enable
, that should execute the delete_pcap program at each reboot, the program doesn't start when the system start. I checked in the folder /etc/rc.d
and I have S10pcap
file (created when I do enable). So, where is the problem?
Why isn't delete_pcap
executed at the system start?