diff options
Diffstat (limited to 'debian/hotplug')
-rw-r--r-- | debian/hotplug | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/hotplug b/debian/hotplug new file mode 100644 index 0000000..ada0b50 --- /dev/null +++ b/debian/hotplug @@ -0,0 +1,45 @@ +#!/bin/sh +# hotplug agent script + +DAEMON_NAME=ifplugd + +DAEMON=/usr/sbin/$DAEMON_NAME +CFG=/etc/default/$DAEMON_NAME + +[ -x $DAEMON ] || exit 0 + +HOTPLUGFUNCS=/etc/hotplug/hotplug.functions +[ -f $HOTPLUGFUNCS ] || exit 1 +. $HOTPLUGFUNCS +DEBUG=yes export DEBUG + +[ "$INTERFACE" ] || { mesg Bad invocation: \$INTERFACE is not set ; exit 1 ; } +case "$INTERFACE" in + # ath* is for Atheros devices using the madwifi driver + # pan* is for the Affix Bluetooth stack + eth*|wlan*|ath*|pan*) + : + ;; + *) + exit 0 + ;; +esac + +[ -f $CFG ] || { mesg No $DAEMON_NAME configuration file ; exit 1 ; } +. $CFG + +case $ACTION in +add|register) + for IF in $HOTPLUG_INTERFACES ; do + if [ "$INTERFACE" = "$IF" -o "$IF" = "all" ] ; then + debug_mesg Invoking $DAEMON_NAME for $INTERFACE + /etc/init.d/$DAEMON_NAME start $INTERFACE + break + fi + done + ;; +remove|unregister) + debug_mesg Stopping $DAEMON_NAME for $INTERFACE + /etc/init.d/$DAEMON_NAME stop $INTERFACE + ;; +esac |