aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-11-03 06:31:32 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-11-03 06:31:32 -0300
commit061e8fc1178721804443863b83dec314908adedb (patch)
tree1453e74f1e5d236048403bcaa9aabfd5286164a3
parent1227c79c21d7a89e8a13bd62a0626ee38027d887 (diff)
downloadkvmx-061e8fc1178721804443863b83dec314908adedb.tar.gz
kvmx-061e8fc1178721804443863b83dec314908adedb.tar.bz2
Check for running guest at destroy, shred and wipe actions
-rwxr-xr-xkvmx21
1 files changed, 18 insertions, 3 deletions
diff --git a/kvmx b/kvmx
index dcc3bf7..bfc4506 100755
--- a/kvmx
+++ b/kvmx
@@ -1329,7 +1329,12 @@ function kvmx_kill {
# Destroy a guest
function kvmx_destroy {
- kvmx_stop
+ #kvmx_stop
+
+ if kvmx_running; then
+ echo "$BASENAME: orig $VM is running, cannot destroy."
+ exit 1
+ fi
rm -f $image
rm -rf $STATE_DIR
@@ -1339,7 +1344,12 @@ function kvmx_destroy {
# Shred a guest
function kvmx_shred {
- kvmx_stop
+ #kvmx_stop
+
+ if kvmx_running; then
+ echo "$BASENAME: orig $VM is running, cannot shred."
+ exit 1
+ fi
if which shred &> /dev/null; then
shred $image
@@ -1352,7 +1362,12 @@ function kvmx_shred {
# Wipe a guest
function kvmx_wipe {
- kvmx_stop
+ #kvmx_stop
+
+ if kvmx_running; then
+ echo "$BASENAME: orig $VM is running, cannot wipe."
+ exit 1
+ fi
if which wipe &> /dev/null; then
wipe -f $image