source: drbl-virt/sbin/xen_install.sh @ 187

Last change on this file since 187 was 187, checked in by rock, 14 years ago

BugFix?: some install error

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/bash
2# Program:
3#  Remove DRBL virt module
4# Author:
5#   Jazz, Rock {jazz, rock}@nchc.org.tw
6# Version:
7#    1.0
8# History:                                                                                         
9#   2010/07/20  Rock    First release (1.0)
10
11# [Source]
12source /opt/drbl-virt/conf/drbl-virt.conf
13source $Work_Path/functions_drbl_virt
14
15# [Main]
16check_systemInfo
17
18# = 1. Install Hypervisior =
19case $Linux_Distribution in
20    # for Ubuntu
21    "Ubuntu")
22        echo "Only support Debain"
23    ;; 
24    # for Debian
25    "Debian")
26        # check xen package
27        check_debian_xen_pkg=""
28        check_debian_xen
29        #echo $check_debian_xen_pkg
30
31        if [ $check_debian_xen_pkg == "no" ]; then
32        echo -e "Don'f find Xen package, please check APT sources.list"
33        exit 0
34        fi
35       
36        # check bit
37        echo $Linux_bit | grep 64 > /dev/null
38        if [ $? == 0 ]; then
39            Linux_bit="amd64"
40        else
41            Linux_bit="686"
42        fi 
43                 
44        # check version
45        echo $Linux_Version | grep "^5" > /dev/null
46        if [ $? == 0 ]; then
47            hypervisior=""
48            check_hypervisior
49            #echo $hypervisior
50
51            if [ $hypervisior == "Xen" ]; then
52                echo ""
53                echo "Install Xen Hypervisior"
54                aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml ipcalc
55                cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp
56                if [ $1 == "stop" ]; then
57                    echo ""
58                    echo "DRBL server default will not enabled xend."
59                    echo "DRBL client default will enabled xend."
60                    update-rc.d xend remove
61                    update-rc.d xendomains remove
62                elif [ $1 == "start" ]; then
63                    update-rc.d xend defaults
64                    update-rc.d xendomains defaults
65                fi
66           
67            else
68                aptitude install kvm
69            fi
70
71        fi 
72    ;; 
73    # for Fedora
74    "Fedora")           
75        echo "Only support Debain"
76    ;; 
77    *) 
78        echo "Only support Debain"
79    ;; 
80esac
81
Note: See TracBrowser for help on using the repository browser.