summaryrefslogtreecommitdiff
path: root/others/vm3/compute/shutdown.sh
diff options
context:
space:
mode:
Diffstat (limited to 'others/vm3/compute/shutdown.sh')
-rwxr-xr-xothers/vm3/compute/shutdown.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/others/vm3/compute/shutdown.sh b/others/vm3/compute/shutdown.sh
new file mode 100755
index 0000000..081499b
--- /dev/null
+++ b/others/vm3/compute/shutdown.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+for vm in "$@"; do
+ sudo virsh shutdown "$vm" > /dev/null 2>&1
+ printf "%-50s%10s\n" "Shutting down $vm..." $([[ $? -eq 0 ]] && echo "Successful" || echo "Failed")
+done