forked from xiaoli110/kvm_vm_setup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
first.sh
32 lines (27 loc) · 865 Bytes
/
first.sh
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
#!/bin/bash
#write by xiaoli
#version 2015 02 15
# get script path
selfpath=$(cd "$(dirname "$0")"; pwd)
echo $selfpath
cd $selfpath
# install guestfish libvirt
yum install libguest* -y
yum install libvirt* -y
yum install virt* -y
# setup el6 Base and winsupport
hostos=`uname -r |grep el6`
if [[ $? -eq 0 ]];then
yum groupinstall Base
echo "host os is CentOS 6, install winsupport"
rpm -ivh $selfpath/virtscript/libguestfs-winsupport-1.0-7.el6.x86_64.rpm
fi
#setup el7 Base and winsupport
hostos=`uname -r |grep el7`
if [[ $? -eq 0 ]];then
yum group install Base
echo "host os is CentOS 7, install lib-virtinst lib-virtcli winsupport"
\cp -r -f $selfpath/virtmod/virtinst /usr/lib/python2.7/site-packages/
\cp -r -f $selfpath/virtmod/virtcli /usr/lib/python2.7/site-packages/
rpm -ivh $selfpath/virtscript/libguestfs-winsupport-7.0-2.el7.x86_64.rpm
fi