diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-08-24 22:27:38 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-08-24 22:27:38 +0000 |
commit | 84cec030dddc3daaf7f6b2c60d285f713f5fd866 (patch) | |
tree | 72b52dd1f1d42b42999274bfdbe314227f2cebf9 | |
parent | 098947479721ab84452799a0a515a234b11af9de (diff) | |
download | pfsense-84cec030dddc3daaf7f6b2c60d285f713f5fd866.zip pfsense-84cec030dddc3daaf7f6b2c60d285f713f5fd866.tar.gz |
More fixes submitted by databeestje
-rw-r--r-- | etc/inc/interfaces.inc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index f97551b..5de292a 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -476,7 +476,9 @@ function interfaces_wireless_configure($if, $wlcfg) { } function find_dhclient_process($interface) { - $pid = `ps ax | grep dhclient | grep {$interface} | cut -f" " -d2`; + if(filter_translate_type_to_real_interface($interface) <> "") + $realinterface = filter_translate_type_to_real_interface($interface); + $pid = `ps ax | grep "[d]hclient" | grep {$realinterface} | awk -F" " '{print $1}'`; return $pid; } @@ -643,6 +645,8 @@ EOD; function interfaces_dhcp_configure($interface) { global $config, $g; + if(filter_translate_type_to_real_interface($interface) <> "") + $realinterface = filter_translate_type_to_real_interface($interface); $optcfg = $config['interfaces'][$interface]; /* generate dhclient_$interface.conf */ @@ -656,7 +660,7 @@ function interfaces_dhcp_configure($interface) { if ($optcfg['dhcphostname']) { $dhclientconf .= <<<EOD -interface "{$optcfg['if']}" { +interface "{$realinterface}" { send dhcp-client-identifier "{$optcfg['dhcphostname']}"; send host-name "{$optcfg['dhcphostname']}"; script "/sbin/dhclient-script"; @@ -736,13 +740,13 @@ function interfaces_wan_dhcp_down() { function interfaces_dhcp_down($interface) { global $config; - $wancfg = $config['interfaces']['wan']; - $wanif = $wancfg['if']; - mwexec("/sbin/ifconfig {$interface} down"); + if(filter_translate_type_to_real_interface($interface) <> "") + $realinterface = filter_translate_type_to_real_interface($interface); + mwexec("/sbin/ifconfig {$realinterface} down"); sleep(1); - $pid_dhclient = `ps awux | grep dhclient | grep {$interface}`; - if($pid_dhclient) - mwexec("kill {$pid_dhclient}"); + $pid = find_dhclient_process($interface); + if($pid) + mwexec("kill {$pid}"); } function interfaces_dhcp_up($interface) { @@ -1072,4 +1076,4 @@ function get_current_wan_address() { } } -?>
\ No newline at end of file +?> |