Update of /cvsroot/devil-linux/build/config/etc/init.d
In directory vz-cvs-3.sog:/tmp/cvs-serv19916/init.d
Modified Files:
network
Log Message:
- added bridge options
- spaces before ROUTE/RULE/BRIDGE_OPTS directives are allowed
Index: network
===================================================================
RCS file: /cvsroot/devil-linux/build/config/etc/init.d/network,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- network 6 Jul 2011 03:43:52 -0000 1.56
+++ network 6 Jul 2011 06:02:34 -0000 1.57
@@ -133,6 +133,7 @@
ROUTE=
RULE=
BR_IF=
+ BRIDGE_OPTS=
BONDING_MASTER=
BONDING_SLAVES=
BONDING_OPTS=
@@ -190,10 +191,19 @@
# bridge
if [ -n "$BR_IF" ] ; then
+ echo "Configuring bridge $DEVICE "
brctl addbr $DEVICE
for i in $BR_IF ; do
brctl addif $DEVICE $i
done
+ if [ -n "$BRIDGE_OPTS" ]; then
+ grep '^\s*BRIDGE_OPTS=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ do
+ eval $line
+ echo " set option \"$BRIDGE_OPTS\" on $DEVICE"
+ brctl $BRIDGE_OPTS
+ done
+ fi
fi
# MAC spoofing only on physical interfaces
@@ -249,7 +259,7 @@
ip link set $DEVICE up $MTU
ifenslave $DEVICE $BONDING_SLAVES $BONDING_OPTS
-
+
fi
if [ "$DHCP" = "yes" ]; then
@@ -311,7 +321,7 @@
# Routes
# Add ipv4 routes
if [ -n "$ROUTE" ]; then
- grep "^ROUTE=" ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ grep '^\s*ROUTE=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
do
eval $line
echo " adding route to \"$ROUTE\" on $DEVICE"
@@ -321,7 +331,7 @@
# Add ipv6 routes
if [ -n "$IPV6ROUTE" ]; then
- grep "^IPV6ROUTE=" ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ grep '^\s*IPV6ROUTE=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
do
eval $line
# add the route
@@ -333,7 +343,7 @@
#
# Rules (advanced routing)
if [ -n "$RULE" ]; then
- grep "^RULE=" ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ grep '^\s*RULE=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
do
eval $line
echo " adding rule \"$RULE\" on $DEVICE"
@@ -377,7 +387,7 @@
# Rules (advanced routing)
if [ -n "$RULE" ]; then
echo "Removing rules from interface $DEVICE"
- grep "^RULE=" ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ grep '^\s*RULE=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
do
eval $line
echo " removing rule \"$RULE\" on $DEVICE"
@@ -388,7 +398,7 @@
# Routes
if [ -n "$ROUTE" ]; then
echo "Removing routes from interface $DEVICE"
- grep "^ROUTE=" ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ grep '^\s*ROUTE=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
do
eval $line
echo " removing route to \"$ROUTE\" on $DEVICE"
@@ -397,7 +407,7 @@
fi
if [ -n "$IPV6ROUTE" ]; then
- grep "^IPV6ROUTE=" ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
+ grep '^\s*IPV6ROUTE=' ${CONFIG_DIR}/${CONFIG_FILE}$IF | while read line;
do
eval $line
# add the route
|