summaryrefslogtreecommitdiff
path: root/debian/ifplugd.udev.agent
diff options
context:
space:
mode:
Diffstat (limited to 'debian/ifplugd.udev.agent')
-rw-r--r--debian/ifplugd.udev.agent23
1 files changed, 20 insertions, 3 deletions
diff --git a/debian/ifplugd.udev.agent b/debian/ifplugd.udev.agent
index d632bff..fe02b51 100644
--- a/debian/ifplugd.udev.agent
+++ b/debian/ifplugd.udev.agent
@@ -19,8 +19,25 @@ DEBUG=yes export DEBUG
[ -f $CFG ] || { mesg No $DAEMON_NAME configuration file ; exit 1 ; }
. $CFG
-for IF in $HOTPLUG_INTERFACES ; do
- if [ "$INTERFACE" = "$IF" -o "$IF" = "all" ] ; then
+# return true (0) if interface from list $1 is in list $2
+# return false (1) otherwise
+search_interfaces () {
+ for IF in $2 ; do
+ for SEARCH_IF in $1 ; do
+ if [ "$SEARCH_IF" = "$IF" ] ; then
+ return 0
+ fi
+ done
+ done
+ return 1
+}
+
+search_interfaces "$INTERFACE" "$INTERFACES"
+if [ $? -gt 0 ] ; then
+ # Interface isn't statically managed by ifplugd
+ search_interfaces "all $INTERFACE" "$HOTPLUG_INTERFACES"
+ if [ $? -eq 0 ] ; then
+ # Interface is in hotplug allowed list
case $ACTION in
add|register)
debug_mesg Invoking $DAEMON_NAME for $INTERFACE
@@ -33,4 +50,4 @@ for IF in $HOTPLUG_INTERFACES ; do
esac
break
fi
-done
+fi