]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Adds shred and wipe actions
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 11 Mar 2017 19:23:17 +0000 (16:23 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 11 Mar 2017 19:23:17 +0000 (16:23 -0300)
kvmx

diff --git a/kvmx b/kvmx
index cf7364cc93771739874feb068c0e7f8e242a4c65..9f71e2898b5c26661e354d5c742588e5d612167a 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -481,6 +481,32 @@ function kvmx_destroy {
   echo "$BASENAME: removed image and state files, but not the whole`dirname $image` folder."
 }
 
+# Shred a guest
+function kvmx_shred {
+  kvmx_stop
+
+  if which shred &> /dev/null; then
+    shred $image
+    rm -f $image
+  else
+    echo "$BASENAME: error shreding $image: shred program not available."
+    exit 1
+  fi
+}
+
+# Wipe a guest
+function kvmx_wipe {
+  kvmx_stop
+
+  if which wipe &> /dev/null; then
+    wipe -f $image
+    rm   -f $image
+  else
+    echo "$BASENAME: error wipeing $image: wipe program not available."
+    exit 1
+  fi
+}
+
 # Purge a guest and all its configuration
 function kvmx_purge {
   kvmx_destroy