summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/hotplug/files/hotplug-20020401-net.agent-gentoo.diff')
-rw-r--r--sys-apps/hotplug/files/hotplug-20020401-net.agent-gentoo.diff48
1 files changed, 48 insertions, 0 deletions
diff --git a/sys-apps/hotplug/files/hotplug-20020401-net.agent-gentoo.diff b/sys-apps/hotplug/files/hotplug-20020401-net.agent-gentoo.diff
new file mode 100644
index 000000000000..638f48f3ab8f
--- /dev/null
+++ b/sys-apps/hotplug/files/hotplug-20020401-net.agent-gentoo.diff
@@ -0,0 +1,48 @@
+diff -auNr hotplug-2002_08_26-orig/etc/hotplug/net.agent hotplug-2002_08_26/etc/hotplug/net.agent
+--- hotplug-2002_08_26-orig/etc/hotplug/net.agent 2001-09-19 17:14:00.000000000 -0700
++++ hotplug-2002_08_26/etc/hotplug/net.agent 2002-10-18 11:58:57.000000000 -0700
+@@ -40,8 +40,12 @@
+ # we can't do much here without distro-specific knowledge
+ # such as whether/how to invoke DHCP, set up bridging, etc.
+
++ # handle gentoo init script style
++ if [ -x /etc/init.d/net.$INTERFACE ]; then
++ debug_mesg invoke /etc/init.d/net.$INTERFACE start
++ exec /etc/init.d/net.$INTERFACE start
+ # RedHat and similar
+- if [ -x /sbin/ifup ]; then
++ elif [ -x /sbin/ifup ]; then
+ debug_mesg invoke ifup $INTERFACE
+ exec /sbin/ifup $INTERFACE
+ else
+@@ -52,6 +56,30 @@
+ mesg $1 $ACTION event not handled
+ ;;
+
++unregister)
++ case $INTERFACE in
++ # interfaces that are unregistered after being "down" (?)
++ ppp*|ippp*|isdn*|plip*|lo*|irda*)
++ debug_mesg assuming $INTERFACE is already down
++ exit 0
++ ;;
++ *)
++ # handle gentoo init script style
++ if [ -x /etc/init.d/net.$INTERFACE ]; then
++ debug_mesg invoke /etc/init.d/net.$INTERFACE stop
++ exec /etc/init.d/net.$INTERFACE stop
++ # RedHat and similar
++ elif [ -x /sbin/ifdown ]; then
++ debug_mesg invoke ifdown $INTERFACE
++ exec /sbin/ifdown $INTERFACE
++ else
++ mesg "how do I bring interfaces down on this distro?"
++ fi
++ ;;
++ esac
++ mesg $1 $ACTION event not handled
++ ;;
++
+ *)
+ debug_mesg NET $ACTION event not supported
+ exit 1 ;;