/
startvm
executable file
·80 lines (74 loc) · 2.07 KB
/
startvm
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# start vm automatically
line=`systemctl status vmware | grep "active (running)"`
case "$1" in
node1)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/node1/centos7.vmx 1>/dev/null 2>&1 &
;;
node2)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/node2/centos7.vmx 1>/dev/null 2>&1 &
;;
node3)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/node3/centos7.vmx 1>/dev/null 2>&1 &
;;
halo)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/halo/centos7.vmx 1>/dev/null 2>&1 &
;;
xp)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/xp/WinXP.vmx 1>/dev/null 2>&1 &
;;
win7)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/win7/win7.vmx 1>/dev/null 2>&1 &
;;
bd)
if [ ! "$line" ]; then
systemctl start vmware
fi
vmplayer /develop/vm/node1/centos7.vmx 1>/dev/null 2>&1 &
vmplayer /develop/vm/node2/centos7.vmx 1>/dev/null 2>&1 &
vmplayer /develop/vm/node3/centos7.vmx 1>/dev/null 2>&1 &
;;
-h)
echo version 1.0
echo Usage: vm {node1 \| node2 \| node3 \| bd \| halo \| xp \| win7}
echo Additional options:
echo " -h"
echo " -v"
;;
-v)
echo vm version: 1.0
;;
*)
echo parameter error! Usage: vm {node1 \| node2 \| node3 \| bd \| halo \| xp \| win7 \| -v \| -h}
;;
esac
# example below:
# vmware-networks version: 0.1
# Usage: vmware-networks [--verbose | -v] <option>
# Use exactly one of these commands:
# --postinstall <component-name>,<old-version>,<new-version>
# --migrate-network-settings <location of settings file>
# --start
# --stop
# --status
# Additional options:
# --help | -h
# --version