blob: 638f48f3ab8f657af211283fe5091df1ecf0ad7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 ;;
|