docklet/conf/lxc-script/lxc-ifdown

17 lines
435 B
Plaintext
Raw Normal View History

#!/bin/sh
2016-04-06 14:47:16 +08:00
# $1 : name of container ( name in lxc-start with -n)
# $2 : net
# $3 : network flags, up or down
# $4 : network type, for example, veth
2017-05-09 01:06:39 +08:00
# $5 : value of lxc.network.veth.pair
2016-04-06 14:47:16 +08:00
ovs-vsctl --if-exists del-port $Bridge $5
2017-05-09 01:06:39 +08:00
cnt=$(ovs-vsctl list-ports ${Bridge} | wc -l)
if [ "$cnt" = "1" ]; then
2019-03-05 01:59:12 +08:00
greport=$(ovs-vsctl list-ports ${Bridge} | grep "gre" | wc -l)
2017-11-19 23:25:21 +08:00
if [ "$greport" = "1" ]; then
ovs-vsctl del-br $Bridge
fi
2017-05-09 01:06:39 +08:00
fi