blob: 6dc42a2f052c8542d373db376a03390e2135f41e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/sh
NORMAL="\033[1;0m"
STRONG="\033[1;1m"
RED="\033[1;31m"
GREEN="\033[1;32m"
print_red() {
local prompt="${RED}${STRONG}$1 ${NORMAL}"
printf "${prompt} %s\n"
}
print_green() {
local prompt="${GREEN}${STRONG}$1 ${NORMAL}"
printf "${prompt} %s\n"
}
db="/etc/openvswitch/conf.db"
if [ -e "$db" ]; then
print_red "\nStopping OVS Database\n"; rc-service ovsdb-server stop
print_green "\nTrying schema migration for $db..."
ovsdb-tool convert "$db" "/usr/share/openvswitch/vswitch.ovsschema"
print_green "\nStarting OVS Database\n"; rc-service ovsdb-server start
else
print_green "\nCreating new Open vSwitch database $db...\n"
ovsdb-tool create "$db" "/usr/share/openvswitch/vswitch.ovsschema"
fi
|