source: drbl-virt/uninstall.sh

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

Bugfix: var error

  • Property svn:executable set to *
File size: 1.9 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# [PATH]
12Work_Home="/opt/drbl-virt"
13Work_Path="/opt/drbl-virt/sbin"
14Now_Path="$(dirname $0)"
15PATH=${PATH}:$Work_Path
16
17# [Source]
18source $Now_Path/sbin/functions_drbl_virt
19# [Main]
20check_systemInfo
21checkroot
22
23# = 1. For linux distribution =
24case $Linux_Distribution in
25    # for Ubuntu
26    "Ubuntu")
27        echo "Only support Debain"
28    ;; 
29    # for Debian
30    "Debian")
31        # check bit
32        echo $Linux_bit | grep 64                                                                                 
33        if [ $? == 0 ]; then
34            Linux_bit="amd64"
35        else
36            Linux_bit="686"
37        fi 
38                 
39        # check version
40        echo $Linux_Version | grep "^5"
41        if [ $? == 0 ]; then
42            hypervisior=check_hypervisior
43            if [ $hypervisior == "Xen" ]; then
44                aptitude remove xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools
45            else
46                aptitude remove kvm
47            fi
48        fi 
49    ;; 
50    # for Fedora
51    "Fedora")           
52        echo "Only support Debain"
53    ;; 
54    *) 
55        echo "Only support Debain"
56    ;; 
57esac
58
59cd
60
61# = 2. Recovery DRBL original file =
62# patch file
63mv -f /usr/bin/mkpxeinitrd-net.drbl-virt_bak /usr/bin/mkpxeinitrd-net
64mv -f /opt/drbl/sbin/generate-pxe-menu.drbl-virt_bak /opt/drbl/sbin/generate-pxe-menu
65mv -f /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init.drbl-virt_bak /usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init
66# drbl env file
67mv -f $Work_Home/etc/IP_HOST_TABLE /etc/drbl/IP_HOST_TABLE
68mv -f $Work_Home/etc/macadr-eth*[0-9].txt
69
70# = 3. Redeploy DRBL original environment =
71
72
73# = 4. Delete path =
74rm -fr $Work_Home
75
76
Note: See TracBrowser for help on using the repository browser.