diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-13 03:59:25 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-13 03:59:25 +0000 |
commit | c511b3696cdf7a4d856cc66ee6ca50f8848dbab3 (patch) | |
tree | 06eaac0e893e5ef7d5fdd89b40efb6727cf7c340 /etc/rc.linkup | |
parent | 8af4ca7b2f3c897568c2ad5be812c8a17f35aaaa (diff) | |
download | pfsense-c511b3696cdf7a4d856cc66ee6ca50f8848dbab3.zip pfsense-c511b3696cdf7a4d856cc66ee6ca50f8848dbab3.tar.gz |
Transfer rc.linkup over to devd
Diffstat (limited to 'etc/rc.linkup')
-rwxr-xr-x | etc/rc.linkup | 95 |
1 files changed, 52 insertions, 43 deletions
diff --git a/etc/rc.linkup b/etc/rc.linkup index 480881c..a26186a 100755 --- a/etc/rc.linkup +++ b/etc/rc.linkup @@ -37,50 +37,59 @@ if($g['booting'] == true) { /* ignore all linkup events */ } else { - - $friendly_interface = convert_real_interface_to_friendly_interface_name($argv[1]); - if($config['interfaces'][$friendly_interface]['ipaddr'] <> "dhcp" and - $config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe" and - $config['interfaces'][$friendly_interface]['ipaddr'] <> "bigpond" and - $config['interfaces'][$friendly_interface]['ipaddr'] <> "pptp") { - log_error("Hotplug event detected for {$argv[1]} but ignoring since interface is not set for DHCP"); - exit; - } - - if($argv[2] == "stop" or $argv[2] == "down") { - log_error("DEVD Ethernet detached event for {$argv[1]}"); - exec("/sbin/ifconfig {$argv[1]} delete"); - exec("/usr/sbin/arp -da"); - exit; - } - - if($argv[2] == "start" or $argv[2] == "up") { - log_error("DEVD Ethernet attached event for {$argv[1]}"); - exec("/sbin/ifconfig {$argv[1]} up"); - exec("/usr/sbin/arp -da"); - } - - if($argv[1] <> "") { - $interface = convert_real_interface_to_friendly_interface_name($argv[1]); - } else { - log_error("WARNING: No interface passed to rc.linkup"); - $interface = "wan"; - } - - if($interface == "wan") { - if($config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe") { - /* do not reconfigure on hotplug events when using pppoe */ - log_error("HOTPLUG: Configuring wan interface {$interface}"); - interfaces_wan_configure(); + $processing = true; + $counter = 1; + while($processing == true) { + if($argv[$counter] == "" or $argv[$counter] == "\n") + exit; + echo "Processing {$argv[$counter]} - {$argv[$counter+1]}\n"; + $friendly_interface = convert_real_interface_to_friendly_interface_name($argv[$counter]); + if($config['interfaces'][$friendly_interface]['ipaddr'] <> "dhcp" and + $config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe" and + $config['interfaces'][$friendly_interface]['ipaddr'] <> "bigpond" and + $config['interfaces'][$friendly_interface]['ipaddr'] <> "pptp") { + log_error("Hotplug event detected for {$argv[$counter]} but ignoring since interface is not set for DHCP"); + $counter++; + $counter++; + } else { + + if($argv[$counter+1] == "stop" or $argv[$counter+1] == "down") { + log_error("DEVD Ethernet detached event for {$argv[$counter]}"); + exec("/sbin/ifconfig {$argv[$counter]} delete"); + exec("/usr/sbin/arp -da"); + } + + if($argv[$counter+1] == "start" or $argv[$counter+1] == "up") { + log_error("DEVD Ethernet attached event for {$argv[$counter]}"); + exec("/sbin/ifconfig {$argv[$counter]} up"); + exec("/usr/sbin/arp -da"); + } + + if($argv[$counter] <> "") { + $interface = convert_real_interface_to_friendly_interface_name($argv[$counter]); + } else { + log_error("WARNING: No interface passed to rc.linkup"); + $interface = "wan"; + } + + if($interface == "wan") { + if($config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe") { + /* do not reconfigure on hotplug events when using pppoe */ + log_error("HOTPLUG: Configuring wan interface {$interface}"); + interfaces_wan_configure(); + } + } else if($interface == "lan") { + log_error("HOTPLUG: Configuring lan interface {$interface}"); + interfaces_lan_configure(); + } else { + log_error("HOTPLUG: Configuring optional interface {$interface}"); + interfaces_optional_configure_if($interface); + } + + $counter++; + $counter++; } - } else if($interface == "lan") { - log_error("HOTPLUG: Configuring lan interface {$interface}"); - interfaces_lan_configure(); - } else { - log_error("HOTPLUG: Configuring optional interface {$interface}"); - interfaces_optional_configure_if($interface); } - } -?> +?>
\ No newline at end of file |