projects
/
grml-network.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove Austrian provider specific configs, modem support
[grml-network.git]
/
sbin
/
grml-bridge
diff --git
a/sbin/grml-bridge
b/sbin/grml-bridge
index
1a4b9c8
..
93e6686
100755
(executable)
--- a/
sbin/grml-bridge
+++ b/
sbin/grml-bridge
@@
-4,17
+4,13
@@
# 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 Okt 11 23:02:51 CEST 2006 [moemoe]
################################################################################
################################################################################
-# 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
+check4root
|| exit 1
if ! [ -r "$CONFIG_FILE" ] ; then
eerror "$CONFIG_FILE could not be read."
if ! [ -r "$CONFIG_FILE" ] ; then
eerror "$CONFIG_FILE could not be read."
@@
-45,13
+41,21
@@
case "$1" in
no|false)
;;
*)
no|false)
;;
*)
- einfo "Setting Spanning-Tree Protocol (STP) to status"
+ einfo "Setting Spanning-Tree Protocol (STP) to status
$STP
"
brctl stp "$BRIDGE_NAME" $STP
eend $?
;;
esac
brctl stp "$BRIDGE_NAME" $STP
eend $?
;;
esac
- einfo "Enabling promiscous mode on: "
+ einfo "Bringing network device up: "
+ eindent
+ for i in $BRIDGE_DEVICES ; do
+ einfo "$i"
+ ifconfig "$i" 0.0.0.0 up ; eend $?
+ done
+ eoutdent
+
+ einfo "Enabling promiscuous mode on: "
eindent
for i in $BRIDGE_DEVICES ; do
einfo "$i"
eindent
for i in $BRIDGE_DEVICES ; do
einfo "$i"
@@
-73,14
+77,14
@@
case "$1" in
case $BRIDGE_CONFIG in
DHCP)
einfo "starting dhclient for $BRIDGE_NAME"
case $BRIDGE_CONFIG in
DHCP)
einfo "starting dhclient for $BRIDGE_NAME"
- dhclient -
e -
pf /var/run/dhclient.$BRIDGE_NAME.pid -lf /var/run/dhclient.$BRIDGE_NAME.leases $BRIDGE_NAME
+ dhclient -pf /var/run/dhclient.$BRIDGE_NAME.pid -lf /var/run/dhclient.$BRIDGE_NAME.leases $BRIDGE_NAME
;;
FIXED)
einfo "Setting IP for $BRIDGE_NAME to $BRIDGE_IP"
ip a a $BRIDGE_IP dev $BRIDGE_NAME
;;
NONE)
;;
FIXED)
einfo "Setting IP for $BRIDGE_NAME to $BRIDGE_IP"
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
@@
-92,7
+96,9
@@
case "$1" in
eindent
if [ $BRIDGE_CONFIG = DHCP ]; then
einfo "Terminating dhclient for $BRIDGE_NAME"
eindent
if [ $BRIDGE_CONFIG = DHCP ]; then
einfo "Terminating dhclient for $BRIDGE_NAME"
- kill $(cat /var/run/dhclient.$BRIDGE_NAME.pid);
+ if [ -r "/var/run/dhclient.$BRIDGE_NAME.pid" ] ; then
+ kill "$(cat /var/run/dhclient.$BRIDGE_NAME.pid)" || /bin/true
+ fi
fi
einfo "Removing network devices from $BRIDGE_NAME: "
fi
einfo "Removing network devices from $BRIDGE_NAME: "
@@
-103,7
+109,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 "
@@
-115,6
+121,7
@@
case "$1" in
ip link set "$BRIDGE_NAME" down; eend $?
einfo "Removing bridge device"
ip link set "$BRIDGE_NAME" down; eend $?
einfo "Removing bridge device"
+ ifconfig "$BRIDGE_NAME" down || /bin/true
brctl delbr "$BRIDGE_NAME"
eend $?
eoutdent
brctl delbr "$BRIDGE_NAME"
eend $?
eoutdent