Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / rhel / etc_sysconfig_network-scripts_ifdown-ovs
index d2a2f4b..6e96d62 100755 (executable)
@@ -34,7 +34,16 @@ if [ ! -x ${OTHERSCRIPT} ]; then
     OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-eth"
 fi
 
-[ -f /var/lock/subsys/openvswitch ] || /sbin/service openvswitch start
+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)
@@ -42,11 +51,14 @@ case "$TYPE" in
                retval=$?
                ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE"
                ;;
-       OVSPort|OVSIntPort|OVSBond)
+       OVSPort|OVSIntPort|OVSBond|OVSTunnel)
                ${OTHERSCRIPT} ${CONFIG} $2
                retval=$?
                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"
                exit 1