aboutsummaryrefslogtreecommitdiffstats
path: root/testing/openvswitch/openvswitch.post-upgrade
diff options
context:
space:
mode:
Diffstat (limited to 'testing/openvswitch/openvswitch.post-upgrade')
-rw-r--r--testing/openvswitch/openvswitch.post-upgrade26
1 files changed, 22 insertions, 4 deletions
diff --git a/testing/openvswitch/openvswitch.post-upgrade b/testing/openvswitch/openvswitch.post-upgrade
index 2c3ea69370..6dc42a2f05 100644
--- a/testing/openvswitch/openvswitch.post-upgrade
+++ b/testing/openvswitch/openvswitch.post-upgrade
@@ -1,11 +1,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
- echo "Trying schema migration for $db..."
- ovsdb-tool convert "$db" "/usr/share/openvswitch/vswitch.ovsschema"
+ 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
- echo "Creating new Open vSwitch database $db..."
- ovsdb-tool create "$db" "/usr/share/openvswitch/vswitch.ovsschema"
+ print_green "\nCreating new Open vSwitch database $db...\n"
+ ovsdb-tool create "$db" "/usr/share/openvswitch/vswitch.ovsschema"
fi
+