Changeset 202 for drbl-virt


Ignore:
Timestamp:
Aug 30, 2010, 2:18:14 PM (14 years ago)
Author:
rock
Message:

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

Location:
drbl-virt
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/install.sh

    r188 r202  
    99#   2010/08/03  Rock    First release (1.0)
    1010
    11 # [PATH]
     11
     12# [Path]
    1213Work_Home="/opt/drbl-virt"
    1314Work_Path="/opt/drbl-virt/sbin"
    1415Now_Path="$(dirname $0)"
    15 PATH=${PATH}:$Work_Path
     16PATH=${PATH}:$Work_Path:${Now_Path}/sbin
    1617
    17 # [Source]
     18# Source]
    1819source $Now_Path/sbin/functions_drbl_virt
    1920
    2021# [Main]
    21 #
    2222check_root
    2323
     
    3535fi
    3636
     37
     38# = 1. Create /opt/drbl-virt and copy file =
    3739mkdir -p $Work_Home
    3840mkdir $Work_Home/etc
     
    4244cp  -fr $Now_Path/uninstall.sh $Work_Home/
    4345
    44 echo "drbl-virt install completion"
    45 echo "Please go to /opt/drbl-virt/ to check"
     46# = 2. Move war =
     47mv drbl-virt.war $Work_Home/
     48
     49# = 4. Install completion =
     50echo ""
     51echo "[drbl-virt install completion]"
     52echo "Please go to /opt/drbl-virt/ to check !!!"
  • drbl-virt/sbin/check_drbl_client.sh

    r200 r202  
    2020
    2121# [Main]
     22drbl_sshkey
    2223for client_IP in $client_IPs
    2324do
    2425    # local variables
    25     client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $2}')"
     26    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
    2627    IP_status="online"
    2728    client_CPU_core=""
  • drbl-virt/sbin/check_drbl_vm.sh

    r200 r202  
    2424    # local variables
    2525    IP_status="online"
    26     client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | awk '{print $2}')"
     26    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
    2727    vm_numbers=""
    2828    vm_hostnames=""
     
    5858            i=i+1
    5959        done
    60    
     60        echo ""
    6161    else
    62         echo "[Error] $client_hostname $client_IP is offline !" && exit 2
     62        echo "[Error] $client_hostname $client_IP is offline !"
    6363
    6464    fi
  • drbl-virt/sbin/drbl_virt.sh

    r187 r202  
    3131$Work_Path/drbl_xen_repush.sh
    3232
     33# = 4. Create User(drbl-virter) and mv drbl-virt.wat to tomcat =
     34creat_drbl-virter
     35install_tomcat_and_mv_drbl-virt
  • drbl-virt/sbin/functions_drbl_virt

    r195 r202  
    8383# [Check Debian Xen package]
    8484function check_debian_xen(){
     85echo "[Check Xen package in apt server]"
     86echo ""
    8587aptitude update
    8688check_debian_xen_pkg=$(aptitude search xen-linux-system)
     
    300302Xen_MAC_5=""
    301303Xen_MAC_6=""
     304VM_Host_totoal_nu=$(cat $Work_Home/etc/IP_VM_$eth | wc -l)
    302305
    303306# backup
     
    307310
    308311# generate MAC
    309 for (( i=1 ; i<"$VM_Host_totoal_nu" ; i++ ))
     312for (( i=1 ; i<="$VM_Host_totoal_nu" ; i++ ))
    310313do
    311314    if [ $i -lt 10 ]; then
     
    325328    fi
    326329done
     330
     331# delete tmp file
     332rm /tmp/drbl-virt_MAC
    327333}
    328334
     
    403409
    404410}
     411
     412
     413# [Creat drbl-virter user]
     414function creat_drbl-virter(){
     415useradd -m -s /bin/bash drbl-virter
     416}
     417
     418
     419# [Download tomcat and mv drbl-virt.wat to wepapps]                           
     420function install_tomcat_and_mv_drbl-virt(){
     421if [ ! -e $Work_Home/tomcat-7.0.2.tar.gz ]; then
     422wget http://drbl-virt.googlecode.com/files/tomcat-7.0.2.tar.gz -P $Work_Home
     423fi                         
     424tar zxvf $Work_Home/tomcat-7.0.2.tar.gz -C $Work_Home/
     425mv $Work_Home/drbl-virt.war $Work_Home/tomcat-7.0.2/webapps/
     426chown -R drbl-virter.drbl-virter $Work_Home/tomcat-7.0.2
     427su  drbl-virter -c "$Work_Home/tomcat-7.0.2/bin/startup.sh"
     428}
  • drbl-virt/sbin/xen_install.sh

    r191 r202  
    5353                echo "[Install Xen Hypervisior]"
    5454                echo ""
    55                 aptitude install xen-linux-system-2.6.26-2-xen-${Linux_bit} xen-tools bridge-utils python-xml ipcalc xtightvncviewer
     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
    5660                cp $Work_Home/conf/debian-lenny_xend-config.sxp /etc/xen/xend-config.sxp
     61                # change java
    5762                if [ $1 == "stop" ]; then
    5863                    echo ""
  • drbl-virt/web/WebContent/drbl_client.jsp

    r194 r202  
    88</head>
    99<body>
    10 developing......
     10developing......[威宇威過威士忌]
    1111</body>
    1212</html>
  • drbl-virt/web/WebContent/drbl_vm.jsp

    r194 r202  
    88</head>
    99<body>
    10 developing......
     10developing......[steven 好帥]
    1111</body>
    1212</html>
  • drbl-virt/web/WebContent/home.html

    r194 r202  
    77<body>
    88developing......
     9[阿嘶大大是小澤圓]
    910</body>
    1011</html>
  • drbl-virt/web/WebContent/link.html

    r194 r202  
    66</head>
    77<body>
    8 developing......
     8developing......[咪咪好可愛]
    99</body>
    1010</html>
Note: See TracChangeset for help on using the changeset viewer.