projects
/
grml-network.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grml-sniff: disable IPv6 to avoid neighbor solicitation/multicast traffic
[grml-network.git]
/
sbin
/
grml-bridge
diff --git
a/sbin/grml-bridge
b/sbin/grml-bridge
index
b15ad98
..
0cfffc5
100755
(executable)
--- a/
sbin/grml-bridge
+++ b/
sbin/grml-bridge
@@
-4,33
+4,25
@@
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Mit Mär 26 23:02:52 CET 2008 [mika]
################################################################################
################################################################################
-# exit on any error
-set -e
-
CONFIG_FILE=/etc/grml/routersetup
. /etc/grml/lsb-functions
. /etc/grml/script-functions
CONFIG_FILE=/etc/grml/routersetup
. /etc/grml/lsb-functions
. /etc/grml/script-functions
-check4root
-
-if ! [ -r "$CONFIG_FILE" ] ; then
- eerror "$CONFIG_FILE could not be read."
- exit 1
-fi
-
-. "$CONFIG_FILE"
+check4root || exit 1
-if [ -z "$BRIDGE_DEVICES" ] ; then
- eerror "Bridge devices (\$BRIDGE_DEVICES) not set in $CONFIG_FILE"
- exit 1
+if [ -r "$CONFIG_FILE" ] ; then
+ . "$CONFIG_FILE"
+else
+ ewarn "Could not read $CONFIG_FILE"
fi
fi
-[ -n "$BRCTL" ] || BRCTL=brctl
-[ -n "$STP" ] || STP=on
-[ -n "$BRIDGE_NAME" ] || BRIDGE_NAME=br0
+# defaults if unconfigured
+[ -n "$BRCTL" ] || BRCTL=brctl
+[ -n "$BRIDGE_STP" ] || BRIDGE_STP=on
+[ -n "$BRIDGE_NAME" ] || BRIDGE_NAME=br0
+[ -n "$BRIDGE_DEVICES" ] || BRIDGE_DEVICES='eth0 eth1'
check4progs $BRCTL || exit 1
check4progs $BRCTL || exit 1
@@
-45,8
+37,8
@@
case "$1" in
no|false)
;;
*)
no|false)
;;
*)
- einfo "Setting Spanning-Tree Protocol (STP) to status $STP"
- brctl stp "$BRIDGE_NAME"
$STP
+ einfo "Setting Spanning-Tree Protocol (STP) to status $
BRIDGE_
STP"
+ brctl stp "$BRIDGE_NAME"
"$BRIDGE_STP"
eend $?
;;
esac
eend $?
;;
esac
@@
-59,7
+51,7
@@
case "$1" in
done
eoutdent
done
eoutdent
- einfo "Enabling promiscous mode on: "
+ einfo "Enabling promisc
u
ous mode on: "
eindent
for i in $BRIDGE_DEVICES ; do
einfo "$i"
eindent
for i in $BRIDGE_DEVICES ; do
einfo "$i"
@@
-88,7
+80,7
@@
case "$1" in
ip a a $BRIDGE_IP dev $BRIDGE_NAME
;;
NONE)
ip a a $BRIDGE_IP dev $BRIDGE_NAME
;;
NONE)
- einfo "Leaving $BRIDGE_NAME uconfigured"
+ einfo "Leaving $BRIDGE_NAME u
n
configured"
;;
esac
eoutdent
;;
esac
eoutdent
@@
-113,7
+105,7
@@
case "$1" in
done
eoutdent
done
eoutdent
- einfo "Disabling promiscous mode on: "
+ einfo "Disabling promisc
u
ous mode on: "
eindent
for i in $BRIDGE_DEVICES ; do
einfo "$i "
eindent
for i in $BRIDGE_DEVICES ; do
einfo "$i "