This one works best for me so far. This eliminates the
extra dhcpcd running after the "service pcmcia
restart" failure to clear dhcpcd (as shown in ps aux)
as well as its pid in /etc/dhcpc/. Note that this
script was not removing the pid from /etc/dhcpc until
I removed the exit. I also removed the echo since the
script is removing this anyway (kind of a forced
ifdown before it brings up eth(n)).
PIDF=/etc/dhcpc/dhcpcd-$DEVICE.pid
if [[ -f $PIDF ]];then
PID=$(cat /etc/dhcpc/dhcpcd-$DEVICE.pid)
if [[ -n $PID ]] && kill -0 $PID;then
- echo "dhpcd is running ifdown it before"
- exit;
fi
+ killall /sbin/dhcpcd
/bin/rm -f $PIDF; #clear it
fi
=====
SI Reasoning
[EMAIL PROTECTED]
A requirement of creativity is that it contributes to change. Creativity keeps
the creator alive.
-FRANK HERBERT, unpublished notes
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com