#!/sbin/bash DH_PID=`ps aux |grep '^.*dhclient eth[0-9].*$'|awk '{print $2}'` #if [ !$DH_PID="" ]; then if [ !$DH_PID ]; then if [ "$DH_PID" = `cat /var/run/dhclient.pid` ]; then echo "killing previously dhclient PID $DH_PID..." kill -9 `cat /var/run/dhclient.pid` /sbin/ifconfig eth1 down fi fi echo "Detach the wireless card and press Enter" read /etc/init.d/network restart