summaryrefslogtreecommitdiffstats
path: root/etc/rc.linkup
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-25 23:43:18 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-25 23:43:18 +0000
commit7a2215437ed23bb1cdced127db99468be964e00b (patch)
treec1fbdaed0ca1d84d6dbce6f298ea373b6dc9e945 /etc/rc.linkup
parent1a97873411ca8def43b8e7dfbdc466bedf406686 (diff)
downloadpfsense-7a2215437ed23bb1cdced127db99468be964e00b.zip
pfsense-7a2215437ed23bb1cdced127db99468be964e00b.tar.gz
Handle ethernet hotplug events correctly
Diffstat (limited to 'etc/rc.linkup')
-rwxr-xr-xetc/rc.linkup22
1 files changed, 14 insertions, 8 deletions
diff --git a/etc/rc.linkup b/etc/rc.linkup
index b935c2f..fc73327 100755
--- a/etc/rc.linkup
+++ b/etc/rc.linkup
@@ -1,7 +1,7 @@
#!/usr/local/bin/php -f
<?php
/*
- rc.linkup
+ rc.linkup - devd hotplug actions
part of pfSense
Copyright (C) 2003-2005 Scott Ullrich <sullrich@gmail.com>.
@@ -33,30 +33,36 @@
require_once("config.inc");
require_once("functions.inc");
- if($argv[2] == "stop") {
+ if($argv[2] == "stop" or $argv[2] == "down") {
+ log_error("DEVD Ethernet detached event for {$argv[1]}");
exec("/sbin/ifconfig {$argv[1]} delete");
exec("/sbin/ifconfig {$argv[1]} down");
- exec("arp -da");
+ exec("/usr/sbin/arp -da");
+ exit;
}
- if($argv[2] == "start") {
- exec("/sbin/ifconfig {$argv[1]} delete");
+ if($argv[2] == "start" or $argv[2] == "up") {
+ log_error("DEVD Ethernet attached event for {$argv[1]}");
exec("/sbin/ifconfig {$argv[1]} up");
- exec("arp -da");
+ exec("/usr/sbin/arp -da");
}
if($argv[1] <> "") {
$interface = convert_real_interface_to_friendly_interface_name($argv[1]);
} else {
- $curwanip = get_current_wan_address();
+ log_error("WARNING: No interface passed to rc.linkup");
$interface = "wan";
}
if($interface == "wan") {
+ 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);
}
-
?> \ No newline at end of file
OpenPOWER on IntegriCloud