annotate mrb/vm_pause.sh @ 0:9e5a3c884de6

Initial import of the virtual testbed.
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 17 Jun 2010 11:00:32 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
1 #!/bin/bash
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
2
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3 # Check params
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 if [ -z "$1" ]; then echo "Donnez le nom de la VM en parametre"; exit 1; fi
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
5
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 # First, start the VM if needed
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 VBoxManage showvminfo "$1" |grep "^State:\s*running" >/dev/null || {
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
8 echo $1 already stopped.
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9 exit 0
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10 }
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 echo "Saving and stopping $1 for resuming later"
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
13
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
14 # Change console to the 5th (alt-F5)
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
15 VBoxManage controlvm "$1" savestate >/dev/null
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
16
9e5a3c884de6 Initial import of the virtual testbed.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
17 # Done
"Welcome to our mercurial repository"