From: Michael Tremer Date: Sun, 10 Mar 2013 13:06:45 +0000 (+0100) Subject: switch: Make sure that the services are properly started. X-Git-Tag: 006~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc603a2b821296b38bcf9ecb0f3a391c3e5b722e;p=network.git switch: Make sure that the services are properly started. --- diff --git a/functions.switch b/functions.switch index e417efdd..5a370efe 100644 --- a/functions.switch +++ b/functions.switch @@ -19,10 +19,23 @@ # # ############################################################################### +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}