summaryrefslogtreecommitdiffstats
path: root/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh
diff options
context:
space:
mode:
authorBilly O'Mahony <billy.o.mahony@intel.com>2016-01-06 17:00:41 +0000
committerMark D. Gray <mark.d.gray@intel.com>2016-01-07 14:14:45 +0000
commit9c5d3a2ab72fa9553924ecaf70ae7ef0d1d562d0 (patch)
treefa7573a61d24cd0712920a04c07e2b48a1020644 /fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh
parentebf6ae51abdaa29eb8eaf9bc41a4187bac6ec0ff (diff)
fuel plugin: Initial version
Change-Id: Ib41afff8f0b0f5e7c2f92f78cbdc48c99891b1ab Signed-off-by: Mark D. Gray <mark.d.gray@intel.com> Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com> Signed-off-by: Michal Ptacek <michalx.ptacek@intel.com> (cherry picked from commit 93f7683a2cd9b8020f8870dfc6b162b3d61c3fd2)
Diffstat (limited to 'fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh')
-rwxr-xr-xfuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh b/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh
new file mode 100755
index 0000000..9110b45
--- /dev/null
+++ b/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/clean.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+# Short script for uninstallation of OVS with DPDK
+
+# enable debugging:
+#set -o xtrace
+
+# Stopping service if needed
+echo "[debug] stopping ovs-dpdk (if needed)"
+sudo service ovs-dpdk status 2>&1 1>/dev/null
+res=$?
+
+if [ $res -eq 2 ]; then
+ echo "[warning] service ovs-dpdk is already stopped"
+else
+ echo "[debug] stopping ovs-dpdk service"
+ sudo service ovs-dpdk stop 2>&1 1>/dev/null
+fi
+
+# Remove ovs-dpdk service
+echo "[debug] removing ovs-dpdk service"
+sudo rm -f /etc/default/ovs-dpdk
+sudo rm -f /etc/init.d/ovs-dpdk
+
+# kvm wrapper
+echo "[debug] replacing kvm wrapper"
+if [ -e /usr/bin/kvm ]; then
+ KVM_CMD="/usr/bin/kvm"
+elif [ -e /usr/bin/qemu-kvm ]; then
+ KVM_CMD="/usr/bin/qemu-kvm"
+elif [ -e /usr/libexec/qemu-kvm ]; then
+ KVM_CMD="/usr/libexec/qemu-kvm"
+else
+ echo "[warning] package qemu-kvm probably not installed"
+fi
+
+cat << 'EOF' | sudo tee $KVM_CMD
+#!/bin/sh
+
+exec /usr/bin/qemu-system-x86_64 "${args[@]}"
+EOF
+
+
+# remove git repos
+echo "[warning] git repos were not automatically removed, you can remove it once you're finished with them"