1 Star 0 Fork 0

Witt/shells

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
startvm 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
#!/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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/mediocrep/shells.git
git@gitee.com:mediocrep/shells.git
mediocrep
shells
shells
main

搜索帮助