<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Java 企業應用
    不要溫柔的走入那個良夜

         首先將需要升級的文件放到一個路徑下面。

         然后指定升級命令,將參數指定到補丁文件的位置和配置文件。

         假設升級文件經過上傳,到了 /opt/package1 中,在package1中,或許是一個單一的解壓后的ifix包,或許是多個zip格式的ifix壓縮包。或許是若干 rpm包。也可能是zip包和rpm包的混合。

         每個ifix文件是zip格式,每個zip文件的根目錄下都有一個配置文件:repository.xml

         而rpm包,則是linux系統上 使用 rpm –Uvh 進行安裝。

         其中,ifix包使用 IBM InstallationManager的指令 imcl進行安裝。

         一個合理的思路就是:

         1.檢測package1下面有無rpm文件,有則將其整理成一個list,交給 rpm –Uvh

         2.檢測package1下面有無 zip文件且zip中必須含有repository.xml文件

         3.如果2中檢測到有符合要求的zip文件,則將其解壓到/opt/package2中,將ifix 路徑傳給 imcl.如果沒有符合要求的zip文件,則檢測當前目錄下,有無repository.xml 有則將package1復制到opt/package2/package1中,交給imcl處理。

    install sh

    #!  /bin/sh
     
    ZIPPATH=/opt/zip
    IFIXTOOL=/home/hailiang/script/ifixtool.sh
    # List Zips 
    listZips() {
      for file in `find $ZIPPATH -type f -name '*.zip'`;do
              (unzip -t "${file}"|grep repository.xml) &> /dev/null && echo $file
                      done
    }
    # Update IM
    updateIM(){
    zipList=`listZips`
            echo "Applying iFixs:"$zipList
    ${IFIXTOOL} $zipList
    }
    # Update RPM
    {
     filename=$1
     echo "Apply rpm fix file(s)"         
             
    rpm -Uvh $filename
    }
     
    # Main
    echo ">> start to install ifix files "
     
    # check if there is any .rpm file under /opt/zip
    rpmCount=`expr $(ls $ZIPPATH/*.rpm 2>/dev/null|wc -l)`
     
    if [ $rpmCount -ne 0 ]; then 
        fixList=`ls $ZIPPATH`
        echo "installing rpm(s):"$fixList
        rpmList=""
        for file in $ZIPPATH/*.rpm;do 
          rpmList=$rpmList" "$file 
        done
        echo "Apply rpm(s):"$rpmList
        rpm -Uvh $rpmList
    fi
     
    # installing ifix and ignore some times.
      echo "ensure permissions are suitable for update"
      chown -hR $username:users /tmp/update
     
     echo "installing ifix" 
     installed=0
     
    #Check whether there is any zip file 
    zipCount=`expr $(listZips|wc -l)`
    if [ $zipCount -eq 0 ]; then
       # Treat is as a single ifix IM repo 
       cd $ZIPPATH
       zip -r fix,zip `find -type f -name repository.xml -exec dirname{} \;`
       cd -
       zipCount=1
    fi   
    fixtotal=$zipCount
    echo $fixtotal needs to be applyed . 
    updateIM
     
    else
      echo " nothing happened."
    fi  
     
    # Remove files 
    rm -rf $ZIPPATH
     
    echo "<< exit"
      
     

        

    tool shell

    #! /bin/sh
     
    # set -x
     
    zipfilelist=""
    for zipfile;do
       if [ -f "$zipfile" ];then 
           zipfiledir=$(cd `dirname "${zipfile}"`;pwd)
           zipfilename=$(basename "${zipfile}")
           zipfilelist="${zipfiledir}/${zipfilename} ${zipfilelist}"
           fi
           done
    echo $zipfilelist    
    #unzip ifix
    rm -rf /tmp/im
    mkdir /tmp/im
    cd /tmp/im
     
    for file  in ${zipfilelist};do
        if [ -f "$file" ]; then 
            filename=$(basename "${file}")
            unzip -d ${filename%.*} "$file"
            fi
    done
     
    posted on 2012-07-17 15:29 cpegtop 閱讀(186) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
     
    主站蜘蛛池模板: 成人无码区免费A片视频WWW| xxxxxx日本处大片免费看| 性xxxx视频免费播放直播| 亚洲精品无码不卡在线播HE| 窝窝影视午夜看片免费| 国产亚洲成人久久| 国产在线国偷精品免费看| 国产亚洲一区区二区在线| 东方aⅴ免费观看久久av| 亚洲av无码专区在线播放| 99精品视频在线观看免费专区| 亚洲精品免费视频| 中文字幕在线观看免费视频| 亚洲欧洲精品视频在线观看| 青娱乐免费视频在线观看| 亚洲AV成人片无码网站| 免费一级毛片不卡不收费| jizz免费在线影视观看网站| 亚洲码国产精品高潮在线| 97国产在线公开免费观看| 国产成人精品亚洲2020| 日韩视频在线免费观看| a级毛片免费观看在线| 久久久无码精品亚洲日韩按摩 | 亚洲AV永久无码精品成人| 久久国产乱子精品免费女 | 国产麻豆剧传媒精品国产免费| 美女又黄又免费的视频| 亚洲三区在线观看无套内射| 3344永久在线观看视频免费首页| 亚洲香蕉久久一区二区| 免费国产在线观看老王影院| 成在人线av无码免费高潮水| 亚洲欧洲国产综合| 亚洲国产成人久久综合一区77 | 最近中文字幕完整版免费高清| 亚洲一级毛片免费观看| 亚洲电影日韩精品 | 日韩免费福利视频| 男女拍拍拍免费视频网站| 亚洲精品福利在线观看|