Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added vm-shutdown
- Loading branch information
1 parent
3981018
commit f78bcb5
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" != "-f" ]; then | ||
echo "ERROR: cowardly refusing to send the shutdown signal to all running VMs." | ||
echo "To override this cowardice, use the -f option with this script." | ||
exit 1 | ||
fi | ||
|
||
for VMNAME in $(VBoxManage list runningvms | tr -d '"' | awk '{print $1}'); do | ||
VBoxManage controlvm "$VMNAME" acpipowerbutton | ||
done |