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

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

Add: Automatic packaging drbl-virt (tar_drbl-virt.sh)

  • Property svn:executable set to *
File size: 2.4 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                echo ""
55                aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml ipcalc xtightvncviewer sun-java6-jre
56                   
57                # setup java
58                update-java-alternatives -s java-6-sun
59
60                cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp
61                # change java
62                if [ $1 == "stop" ]; then
63                    echo ""
64                    echo "DRBL server default will not enabled xend."
65                    echo "DRBL client default will enabled xend."
66                    update-rc.d xend remove
67                    update-rc.d xendomains remove
68                elif [ $1 == "start" ]; then
69                    update-rc.d xend defaults
70                    update-rc.d xendomains defaults
71                fi
72           
73            else
74                aptitude install kvm
75            fi
76
77        fi 
78    ;; 
79    # for Fedora
80    "Fedora")           
81        echo "Only support Debain"
82    ;; 
83    *) 
84        echo "Only support Debain"
85    ;; 
86esac
87
Note: See TracBrowser for help on using the repository browser.