]> git.ipfire.org Git - people/stevee/network.git/commitdiff
switch: Make sure that the services are properly started.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Mar 2013 13:06:45 +0000 (14:06 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Mar 2013 13:06:45 +0000 (14:06 +0100)
functions.switch

index e417efdd76ad3a16c04d888565db229f1e24d2c5..5a370efe719db5782f9f3cbd697b39f488ee9c7b 100644 (file)
 #                                                                             #
 ###############################################################################
 
+function switch_start() {
+       local service="openvswitch.service"
+
+       if ! service_is_active "${service}"; then
+               service_start "${service}"
+       fi
+
+       return ${EXIT_OK}
+}
+
 function switch_create() {
        local device=${1}
        assert isset device
 
+       # Make sure that the openvswitch service is running.
+       switch_start
+
        log DEBUG "Creating virtual switch: ${device}"
        ovs-vsctl -- --may-exist add-br ${device}