X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=rhel%2Fetc_sysconfig_network-scripts_ifdown-ovs;h=6e96d62a28fcea17e8c8ce08571759cb3ec9f55b;hb=HEAD;hp=3b5252d7adb94f1773132433a97232dc962c9207;hpb=0fb426263e7834f7403eefd860cf5d36d43f8c45;p=sliver-openvswitch.git diff --git a/rhel/etc_sysconfig_network-scripts_ifdown-ovs b/rhel/etc_sysconfig_network-scripts_ifdown-ovs index 3b5252d7a..6e96d62a2 100755 --- a/rhel/etc_sysconfig_network-scripts_ifdown-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifdown-ovs @@ -22,6 +22,7 @@ cd /etc/sysconfig/network-scripts [ -f ../network ] && . ../network CONFIG=${1} +TIMEOUT=10 source_config @@ -33,16 +34,30 @@ if [ ! -x ${OTHERSCRIPT} ]; then OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth" fi +SERVICE_UNIT=/usr/lib/systemd/system/openvswitch-nonetwork.service +if [ -f $SERVICE_UNIT ] && [ -x /usr/bin/systemctl ]; then + if ! systemctl --quiet is-active openvswitch-nonetwork.service; then + systemctl start openvswitch-nonetwork.service + fi +else + if [ ! -f /var/lock/subsys/openvswitch ]; then + /sbin/service openvswitch start + fi +fi + case "$TYPE" in OVSBridge) ${OTHERSCRIPT} ${CONFIG} $2 retval=$? - ovs-vsctl -- --if-exists del-br "$DEVICE" + ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE" ;; - OVSPort|OVSIntPort|OVSBond) + OVSPort|OVSIntPort|OVSBond|OVSTunnel) ${OTHERSCRIPT} ${CONFIG} $2 retval=$? - ovs-vsctl -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" + ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" + ;; + OVSPatchPort) + ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" ;; *) echo $"Invalid OVS interface type $TYPE"