--- /etc/rc.d/network.old 2006-03-20 09:56:22.000000000 +0100 +++ /etc/rc.d/network 2006-03-20 10:56:17.000000000 +0100 @@ -231,6 +231,26 @@ ifdown $ifline || error=1 fi done + # If the user remove a *dhcp* interface from the Interfaces array, we should kill the dhcp running for it + # Creating a list of removed dhcp interfaces + running_dhcp_interfaces=`ls /etc/dhcpc | grep pid | cut -d "." -f 1 | cut -d "-" -f 2` + has_dhcp_interfaces=() + remove_dhcp_interfaces=${running_dhcp_interfaces[*]} + for ifline in ${INTERFACES[@]}; do + if [ "${ifline}" == "dhcp" ]; then + has_dhcp_interfaces=(${has_dhcp_interfaces[*]} $ifline) + fi + done + for ifline in ${has_dhcp_interfaces[@]}; do + remove_dhcp_interfaces=(${remove_dhcp_interfaces[*]//$ifline/}) + done + + # Ok now the dhcp interfaces that needs to be removed + # are in remove_dhcp_interfaces array, so lets remove them :P + for ifline in ${remove_dhcp_interfaces[@]}; do + ifdown $ifline || error=1 + done + # bring down bridge interfaces bridge_down if [ $error -eq 0 ]; then