#!/bin/sh
# Stefan Tomanek <stefan.tomanek@wertarbyte.de>
# http://wertarbyte.de/debian/
#
# This scripts takes down specified network interfaces
# when connecting a new one. This is useful if you are
# able to connect to the same network through several ways,
# e.g. WLAN and wired interfaces

if [ -n "$IF_CONFLICTS" ]; then
  if [ "$MODE" = "start" ]; then
      for ENTRY in "$IF_CONFLICTS"; do
        if egrep -q "^$ENTRY($|=)" /etc/network/run/ifstate; then
            /sbin/ifdown "$ENTRY"
        fi
      done
  else
      :
  fi
fi
