--- hotplug-2003_05_01/etc/hotplug/net.agent~busybox +++ hotplug-2003_05_01/etc/hotplug/net.agent @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Network hotplug policy agent for Linux 2.4 kernels # @@ -17,7 +17,7 @@ # cd /etc/hotplug -. hotplug.functions +. ./hotplug.functions # DEBUG=yes export DEBUG if [ "$INTERFACE" = "" ]; then @@ -36,11 +36,6 @@ ;; # interfaces that are registered then brought up *) - # NOTE: network configuration relies on administered state, - # we can't do much here without distro-specific knowledge - # such as whether/how to invoke DHCP, set up bridging, etc. - - # RedHat and similar if [ -x /sbin/ifup ]; then debug_mesg invoke ifup $INTERFACE exec /sbin/ifup $INTERFACE @@ -52,6 +47,27 @@ mesg $1 $ACTION event not handled ;; +unregister) + case $INTERFACE in + # interfaces that are unregistered after being "down" + ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*) + debug_mesg assuming $INTERFACE is already down + exit 0 + ;; + + # interfaces that are registered then brought down + *) + if [ -x /sbin/ifdown ]; then + debug_mesg invoke ifdown $INTERFACE + exec /sbin/ifdown $INTERFACE + else + mesg "how do I bring interfaces up on this distro?" + fi + ;; + + esac + mesg $1 $ACTION event not handled + ;; *) debug_mesg NET $ACTION event not supported exit 1 ;; --- hotplug-2003_05_01/etc/hotplug/scsi.agent~busybox +++ hotplug-2003_05_01/etc/hotplug/scsi.agent @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # SCSI hotplug agent for 2.5 kernels # @@ -7,7 +7,7 @@ # cd /etc/hotplug -. hotplug.functions +. ./hotplug.functions case $ACTION in --- hotplug-2003_05_01/etc/hotplug/usb.handmap~busybox +++ hotplug-2003_05_01/etc/hotplug/usb.handmap @@ -3,7 +3,7 @@ # with special driver mappings that the kernel # for some reason does not expose through modutils # -# Comments get read by bash so dont use punctuation +# Comments get read by the shell so dont use punctuation # RETEST ESPECIALLY AFER CHANGES TO COMMENTS # # --- hotplug-2003_05_01/etc/hotplug.d/default/default.hotplug~busybox +++ hotplug-2003_05_01/etc/hotplug.d/default/default.hotplug @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This version of /sbin/hotplug should works on most GNU/Linux systems # using Linux 2.2.18+ or 2.4.* kernels. On 2.2.*, only USB has such @@ -24,7 +24,7 @@ # cd /etc/hotplug -. hotplug.functions +. ./hotplug.functions # DEBUG=yes export DEBUG --- hotplug-2003_05_01/etc/hotplug/hotplug.functions~busybox +++ hotplug-2003_05_01/etc/hotplug/hotplug.functions @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Setup and utility functions for use in hotplug agents # @@ -25,7 +25,7 @@ # # for diagnostics # -if [ -t -o ! -x /usr/bin/logger ]; then +if [ ! -x /usr/bin/logger ]; then mesg () { echo "$@" } @@ -40,15 +40,9 @@ mesg "$@" } -# -# The modules.*map parsing uses BASH ("declare -i") and some version -# of AWK, typically /bin/gawk. Most GNU/Linux distros have these, -# but some specialized ones (floppy based, etc) may not. ("type -p" -# is also a bash-ism, more robust than "which".) -# -AWK=`type -p gawk` +AWK=`which gawk` if [ "$AWK" = "" ]; then - AWK=`type -p awk` + AWK=`which awk` fi --- hotplug-2003_05_01/etc/hotplug/usb.rc~busybox +++ hotplug-2003_05_01/etc/hotplug/usb.rc @@ -75,7 +75,7 @@ # # synthesize hotplug events if we can - # we need (non-bash) programs to parse descriptors. + # we need (non-shell) programs to parse descriptors. LISTER=`type -p usbmodules` if [ "$LISTER" = "" -o ! -f /proc/bus/usb/devices ]; then echo $"** can't synthesize root hub events" --- hotplug-2003_05_01/etc/hotplug/ieee1394.agent~busybox +++ hotplug-2003_05_01/etc/hotplug/ieee1394.agent @@ -24,7 +24,7 @@ # cd /etc/hotplug -. hotplug.functions +. ./hotplug.functions # DEBUG=yes export DEBUG # generated by modutils 2.4.9 or later, for 2.4.10 and later kernels --- hotplug-2003_05_01/etc/hotplug/pci.agent~busybox +++ hotplug-2003_05_01/etc/hotplug/pci.agent @@ -33,7 +33,7 @@ # cd /etc/hotplug -. hotplug.functions +. ./hotplug.functions # generated by modutils, for current 2.4.x kernels MAP_CURRENT=$MODULE_DIR/modules.pcimap --- hotplug-2003_05_01/etc/hotplug/usb.agent~busybox +++ hotplug-2003_05_01/etc/hotplug/usb.agent @@ -79,7 +79,7 @@ fi cd /etc/hotplug -. hotplug.functions +. ./hotplug.functions # DEBUG=yes export DEBUG # generated by modutils, for current 2.4.x (and later) kernels --- hotplug-2003_05_01/etc/hotplug/pci.rc~busybox +++ hotplug-2003_05_01/etc/hotplug/pci.rc @@ -17,7 +17,7 @@ . /etc/rc.d/init.d/functions fi -. hotplug.functions +. ./hotplug.functions # # override any of the defaults?