X-Git-Url: http://git.grml.org/?p=grml-network.git;a=blobdiff_plain;f=sbin%2Fgrml-bridge;h=0cfffc5fcb3096dca9c4b1cf3a2c8aca92e3ca8a;hp=93e6686f69f685050cd81a306c88ce216aacb9e2;hb=af7e79258099000fb08013a77e1e83680ca4a59f;hpb=4dd28e782446cb5101be9cb1ce5eb3d4df4003e3 diff --git a/sbin/grml-bridge b/sbin/grml-bridge index 93e6686..0cfffc5 100755 --- a/sbin/grml-bridge +++ b/sbin/grml-bridge @@ -12,21 +12,17 @@ CONFIG_FILE=/etc/grml/routersetup check4root || exit 1 -if ! [ -r "$CONFIG_FILE" ] ; then - eerror "$CONFIG_FILE could not be read." - exit 1 +if [ -r "$CONFIG_FILE" ] ; then + . "$CONFIG_FILE" +else + ewarn "Could not read $CONFIG_FILE" fi -. "$CONFIG_FILE" - -if [ -z "$BRIDGE_DEVICES" ] ; then - eerror "Bridge devices (\$BRIDGE_DEVICES) not set in $CONFIG_FILE" - exit 1 -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 @@ -41,8 +37,8 @@ case "$1" in 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