git://git.onelab.eu
/
nodemanager-topo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1 LinkSpec per link. The array defines more than 1 linkspec.
[nodemanager-topo.git]
/
teardown-egre-link
diff --git
a/teardown-egre-link
b/teardown-egre-link
index
77cc1d1
..
efa2aea
100755
(executable)
--- a/
teardown-egre-link
+++ b/
teardown-egre-link
@@
-1,17
+1,19
@@
#!/bin/sh +x
#!/bin/sh +x
-SLICE=$1
-SLICEID=`id -u $SLICE`
-NODEID=$2
-KEY=$3
+NODEID=$1
+KEY=$2
LINK=${KEY}x${NODEID}
EGRE=d$LINK
BRIDGE=c$LINK
ETUN1=b$LINK
LINK=${KEY}x${NODEID}
EGRE=d$LINK
BRIDGE=c$LINK
ETUN1=b$LINK
-# Remove iptables rule
-iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
+MARK=`iptables -t mangle -L -v|grep -m 1 $BRIDGE|awk '{print $NF}'`
+
+# Remove iptables rules. Sometimes there is more than one.
+while [ $? -eq 0 ]; do
+ iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $MARK
+done
# Get rid of etun devices, only need name of one of them
echo $ETUN1 > /sys/module/etun/parameters/delif
# Get rid of etun devices, only need name of one of them
echo $ETUN1 > /sys/module/etun/parameters/delif