[171] | 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] |
---|
| 12 | source /opt/drbl-virt/conf/drbl-virt.conf |
---|
[175] | 13 | source $Work_Path/functions_drbl_virt |
---|
[171] | 14 | |
---|
| 15 | # [Main] |
---|
| 16 | check_systemInfo |
---|
| 17 | |
---|
| 18 | case $Linux_Distribution in |
---|
| 19 | # for Ubuntu |
---|
| 20 | "Ubuntu") |
---|
| 21 | echo "Only support Debain" |
---|
| 22 | ;; |
---|
| 23 | # for Debian |
---|
| 24 | "Debian") |
---|
| 25 | # check xen package |
---|
| 26 | check_debian_xen_pkg="" |
---|
| 27 | check_debian_xen |
---|
| 28 | echo $check_debian_xen_pkg |
---|
| 29 | |
---|
| 30 | if [ $check_debian_xen_pkg == "no" ]; then |
---|
| 31 | echo -e "Don'f find Xen package, please check APT sources.list" |
---|
| 32 | exit 0 |
---|
| 33 | fi |
---|
| 34 | |
---|
| 35 | # check bit |
---|
| 36 | echo $Linux_bit | grep 64 > /dev/null |
---|
| 37 | if [ $? == 0 ]; then |
---|
| 38 | Linux_bit="amd64" |
---|
| 39 | else |
---|
| 40 | Linux_bit="686" |
---|
| 41 | fi |
---|
| 42 | |
---|
| 43 | # check version |
---|
| 44 | echo $Linux_Version | grep "^5" > /dev/null |
---|
| 45 | if [ $? == 0 ]; then |
---|
| 46 | hypervisior="" |
---|
| 47 | check_hypervisior |
---|
| 48 | echo $hyprtvisior |
---|
| 49 | |
---|
| 50 | if [ $hypervisior == "Xen" ]; then |
---|
[179] | 51 | echo "" |
---|
| 52 | echo "Install Xen Hypervisior" |
---|
| 53 | aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml |
---|
| 54 | cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp |
---|
[178] | 55 | if [ $1 == "stop" ]; then |
---|
[179] | 56 | echo "" |
---|
| 57 | echo "DRBL server default will not enabled xend." |
---|
| 58 | echo "DRBL client default will enabled xend." |
---|
[178] | 59 | update-rc.d xend remove |
---|
| 60 | update-rc.d xendomains remove |
---|
| 61 | elif [ $1 == "start" ]; then |
---|
| 62 | update-rc.d xend defaults |
---|
| 63 | update-rc.d xendomains defaults |
---|
| 64 | fi |
---|
| 65 | |
---|
[171] | 66 | else |
---|
| 67 | aptitude install kvm |
---|
| 68 | fi |
---|
[178] | 69 | |
---|
[171] | 70 | fi |
---|
| 71 | ;; |
---|
| 72 | # for Fedora |
---|
| 73 | "Fedora") |
---|
| 74 | echo "Only support Debain" |
---|
| 75 | ;; |
---|
| 76 | *) |
---|
| 77 | echo "Only support Debain" |
---|
| 78 | ;; |
---|
| 79 | esac |
---|
| 80 | |
---|