--- ifplugd 2004-05-26 11:27:33.221156712 -0400 +++ /etc/init.d/ifplugd 2004-05-26 10:53:16.315853848 -0400 @@ -9,6 +9,18 @@ IFPLUGD=/usr/sbin/ifplugd +# Get routines to bring interfaces up/down to listen for events. These are in +# /etc/init.d/ifplugdupdown.sh, but /etc/conf.d/net includes some configuration +# for them, and SHOULD include ifplugdupdown.sh directly (to add to the preup +# and postdown functions). Thus, we just include /etc/conf.d/net directly here. +source /etc/conf.d/net +if [[ "$(type -t ifplugd_preup)" != function || \ + "$(type -t ifplugd_postdown)" != function ]] ; then + eerror "ifplugd functions not defined. +You must source /etc/init.d/ifplugdupdown.sh in /etc/conf.d/net" + return 1 +fi + [ -z "$INTERFACES" ] && INTERFACES="eth0" [ "$INTERFACES" = "auto" ] && INTERFACES=$(sed -ne 's/.*\<\(eth[0-9]*\):.*/\1/p' /proc/net/dev) @@ -62,9 +74,17 @@ iargs="${iargs} $(get_opt ${IF} ARGS '')" echo -n "${IF} " +#Bring the interface up so we can receive events. + if [ "${action}" = "start" ] ; then + ifplugd_postdown ${IF} -q + fi ${IFPLUGD} ${dargs} --iface=${IF} ${iargs} check_success ${IF} ${action} $? status=$? +#net.eth0 left the interfaces up for us, so we take them down if requested. + if [ "${action}" = "stop" -a "${SHUTDOWN}" = "yes" ] ; then + ifplugd_preup ${IF} -q + fi [ $status ] || break done