Revision adab3c25
Added by Scott Ullrich over 18 years ago
etc/rc.linkup | ||
---|---|---|
2 | 2 |
<?php |
3 | 3 |
/* |
4 | 4 |
rc.linkup - devd hotplug actions |
5 |
part of pfSense
|
|
5 |
part of pfSense |
|
6 | 6 |
|
7 | 7 |
Copyright (C) 2003-2005 Scott Ullrich <sullrich@gmail.com>. |
8 | 8 |
All rights reserved. |
... | ... | |
43 | 43 |
if($argv[$counter] == "" or $argv[$counter] == "\n") { |
44 | 44 |
exit; |
45 | 45 |
} |
46 |
echo "Processing {$argv[$counter]} - {$argv[$counter+1]}\n";
|
|
46 |
log_error("Processing {$argv[$counter]} - {$argv[$counter+1]}\n");
|
|
47 | 47 |
$friendly_interface = convert_real_interface_to_friendly_interface_name($argv[$counter]); |
48 | 48 |
if($config['interfaces'][$friendly_interface]['ipaddr'] <> "dhcp" and |
49 | 49 |
$config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe" and |
... | ... | |
53 | 53 |
$counter++; |
54 | 54 |
$counter++; |
55 | 55 |
} else { |
56 |
|
|
56 |
|
|
57 | 57 |
if($argv[$counter+1] == "stop" or $argv[$counter+1] == "down") { |
58 | 58 |
log_error("DEVD Ethernet detached event for {$argv[$counter]}"); |
59 | 59 |
exec("/sbin/ifconfig {$argv[$counter]} delete"); |
60 | 60 |
exec("/usr/sbin/arp -da"); |
61 | 61 |
} |
62 |
|
|
62 |
|
|
63 | 63 |
if($argv[$counter+1] == "start" or $argv[$counter+1] == "up") { |
64 | 64 |
log_error("DEVD Ethernet attached event for {$argv[$counter]}"); |
65 | 65 |
exec("/sbin/ifconfig {$argv[$counter]} up"); |
66 | 66 |
exec("/usr/sbin/arp -da"); |
67 | 67 |
} |
68 |
|
|
68 |
|
|
69 | 69 |
if($argv[$counter] <> "") { |
70 | 70 |
$interface = convert_real_interface_to_friendly_interface_name($argv[$counter]); |
71 | 71 |
} else { |
72 | 72 |
log_error("WARNING: No interface passed to rc.linkup"); |
73 | 73 |
$interface = "wan"; |
74 | 74 |
} |
75 |
|
|
75 |
|
|
76 | 76 |
if($interface == "wan") { |
77 | 77 |
if($config['interfaces'][$friendly_interface]['ipaddr'] <> "pppoe") { |
78 | 78 |
/* do not reconfigure on hotplug events when using pppoe */ |
... | ... | |
84 | 84 |
interfaces_lan_configure(); |
85 | 85 |
} else { |
86 | 86 |
$int = str_replace("opt", "", $interface); |
87 |
interfaces_optional_configure_if($int);
|
|
87 |
interfaces_optional_configure_if($int); |
|
88 | 88 |
echo "interfaces_optional_configure_if($int);\n"; |
89 | 89 |
log_error("HOTPLUG: Configuring optional interface {$interface}"); |
90 | 90 |
} |
91 |
|
|
91 |
|
|
92 |
$counter++; |
|
92 | 93 |
$counter++; |
93 |
$counter++; |
|
94 | 94 |
} |
95 | 95 |
} |
96 | 96 |
} |
Also available in: Unified diff
Instead of echoing out the value where nobody will see it, send it to log_error() so we can ensure the values are correct and aide in debugging this dhclient issue.