|
|
# we can't do much here without distro-specific knowledge | # we can't do much here without distro-specific knowledge |
# such as whether/how to invoke DHCP, set up bridging, etc. | # 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 | # RedHat and similar |
if [ -x /sbin/ifup ]; then |
elif [ -x /sbin/ifup ]; then |
debug_mesg invoke ifup $INTERFACE | debug_mesg invoke ifup $INTERFACE |
exec /sbin/ifup $INTERFACE | exec /sbin/ifup $INTERFACE |
else | else |
|
|
mesg $1 $ACTION event not handled | 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 | debug_mesg NET $ACTION event not supported |
exit 1 ;; | exit 1 ;; |