summaryrefslogtreecommitdiff
path: root/others/vm3/compute/shutdown.sh
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-12-22 19:03:49 +0800
committerYour Name <you@example.com>2024-12-22 19:03:49 +0800
commitf7f159a04671690786de2f84e34046c103521d58 (patch)
tree22b45e904c1aa6800250ec6e998d0022fd018ade /others/vm3/compute/shutdown.sh
parent2916e3eff503473f6bf8b90e0921b0ccd347166f (diff)
vm.shupdate
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