Click to See Complete Forum and Search --> : Very simple init script question...


kuber
08-05-2001, 02:23 PM
In my /etc/rc.d/rc.4 (bsd-style init scripts) I run /sbin/dhcpcd..
Sometimes if my system reboots dhcpcd does not run because there exists /var/run/dhcpcd-eth0.pid.
I would like to include in the rc.4 something that will say if it is there it will delete it, otherwise it will not even try. I have no idea how...

Thanks,
Kuber

7
08-05-2001, 03:24 PM
You could put

if [ -f /var/run/dhcpcd-eth0.* ]; then
rm -f /var/run/dhcpcd-eth0.*
fi

just above the /sbin/dhcpcd line.

[ 05 August 2001: Message edited by: 7 ]

kuber
08-05-2001, 03:59 PM
Thanks!