-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVBoxMaestro.sh
More file actions
executable file
·50 lines (44 loc) · 932 Bytes
/
VBoxMaestro.sh
File metadata and controls
executable file
·50 lines (44 loc) · 932 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#VBoxManager bash script handler
command=$1
server="${@:2}"
case "$command" in
'start')
echo "Will start machine: ""$server"
VBoxManage startvm $server --type=headless
echo "DONE; \n"
;;
'save')
echo "Will save machine: ""$server"
for server
do
if [ "$server" != "save" ] && [ "$server" != "start" ]
then
VBoxManage controlvm $server savestate
fi
done
echo "DONE; \n"
;;
'boot')
echo "Will load from ./boot"
set -- $(<./boot)
VBoxManage startvm $@ --type=headless
echo "DONE; \n"
;;
'sleep')
echo "Will save all the machines!"
VBoxManage list vms > ./.tmp
what=`grep -o '".*"' .tmp | sed 's/"//g'`
runningMachines=$what
for runningMachines in `echo $runningMachines`
do
echo "Saving Maschine: $runningMachines"
VBoxManage controlvm $runningMachines savestate
echo "DONE;"
echo ""
done
;;
'*')
echo "Unknown command: $command"
;;
esac