From fc603a2b821296b38bcf9ecb0f3a391c3e5b722e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 10 Mar 2013 14:06:45 +0100 Subject: [PATCH] switch: Make sure that the services are properly started. --- functions.switch | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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} -- 2.47.2