-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop-all.sh
More file actions
executable file
·36 lines (31 loc) · 843 Bytes
/
stop-all.sh
File metadata and controls
executable file
·36 lines (31 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#
# This stops the all running vms
#
# gnd @ gnd.sk, 2017 - 2019
#
####################################################################
# Check if LIMA_ROOT set
if [ -z $LIMA_ROOT ]; then
echo "Cant find LIMA. Please check if the install finished correctly."
echo "Exiting. Reason: LIMA_ROOT not set."
exit
fi
# Define globals
source $LIMA_ROOT/vms/settings
usage() {
printf "\n"
printf "This stops all VMs listed in vmlist\n"
printf "Usage: \n"
printf "$0 \n\n"
}
# Warn the user
clear
echo "This will stop all machines at once"
echo "It might take a few minutes for all VMs to stop. Check list-vm to see what machines are still running"
sleep 5
### Stop all running VMS from vmlist
for VM_NAME in `cat $VM_LIST | awk {'print $2;'}`
do
$SCRIPT_DIR/stop-vm.sh name $VM_NAME &
done