#!/bin/sh NORMAL="\033[1;0m" STRONG="\033[1;1m" GREEN="\033[1;32m" print_green() { local prompt="${GREEN}${STRONG}$1 ${NORMAL}" printf "${prompt} %s\n" } db="/etc/openvswitch/conf.db" if [ -e "$db" ]; then print_green "\nTrying schema migration for $db..." ovsdb-tool convert "$db" "/usr/share/openvswitch/vswitch.ovsschema" else print_green "\nCreating new Open vSwitch database $db...\n" ovsdb-tool create "$db" "/usr/share/openvswitch/vswitch.ovsschema" fi