aboutsummaryrefslogtreecommitdiffstats
path: root/testing/openvswitch/openvswitch.post-install
blob: 3dfef0db6a4cf35da3cf75c6a1448f84f240f8cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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