<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 閱讀(192) 評論(0)  編輯  收藏

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


    網站導航:
     
     
    主站蜘蛛池模板: 免费成人在线视频观看| 国产成人亚洲午夜电影| 国产亚洲免费的视频看| 亚洲伊人久久成综合人影院| 国产AV无码专区亚洲AV麻豆丫| 免费视频中文字幕| 亚洲精品无码专区| 麻豆成人精品国产免费| 亚洲中文字幕无码久久2020| 在线免费一区二区| 亚洲狠狠色丁香婷婷综合| 国产小视频在线免费| 美女视频黄视大全视频免费的| 日韩免费高清视频网站| 美女免费视频一区二区| 狠狠色婷婷狠狠狠亚洲综合| 国产自国产自愉自愉免费24区 | A级毛片成人网站免费看| 亚洲中文字幕无码一久久区| 国产色爽免费无码视频| 亚洲嫩模在线观看| 国内精自视频品线六区免费 | 国产gav成人免费播放视频| 国产精品亚洲综合天堂夜夜| 亚洲国产成人乱码精品女人久久久不卡 | 2020国产精品亚洲综合网| 免费的一级片网站| 男女男精品网站免费观看| 国产亚洲精品自在久久| 91av免费观看| 久久亚洲精品无码gv| 亚洲中文字幕第一页在线| 亚洲国产精品免费在线观看| 亚洲精品人成网线在线播放va| 免费A级毛片无码A| 午夜免费啪视频在线观看| 国产精品久久亚洲不卡动漫| 亚洲精品麻豆av| 最近在线2018视频免费观看| 国产亚洲精品成人久久网站| 国产av天堂亚洲国产av天堂|