Ignore:
Timestamp:
Jun 25, 2010, 2:24:39 PM (14 years ago)
Author:
waue
Message:

更改檢查work_path 的路徑設定方法
檢查更新流程

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/shell/install_func.sh

    r219 r224  
    11#!/bin/bash
    2 #source $Work_Path/lang_link
    32
    43# shell檔及壓縮檔在同一目錄中
     
    109Index_DB=$User_HOME/search
    1110Admin_email=nutchuser@nutch
    12 Start_PATH=`pwd`
     11# Work_Path=(define on install)
     12Install_Dir=$Work_Path/../
    1313MasterIP_Address=`/sbin/ifconfig eth0 | grep 'inet addr' |  sed 's/^.*addr://g' | sed 's/Bcast.*$//g' | sed 's/ .*// '`
    1414net_MacAddr=`/sbin/ifconfig eth0 | grep 'HW' | sed 's/^.*HWaddr //g'`
     
    8585function unzip_nV2_pack(){
    8686  local pac_name=nutchez-0.2pack-current.tar.gz
    87   local svn_ver=218
    88   if [ ! -d "./package" ];then
     87  if [ ! -d "$Install_Dir/package" ];then
    8988    mkdir ./package
    9089  fi
    91   if [ ! -e "./package/$pac_name" ];then
    92     wget "http://trac.nchc.org.tw/cloud/export/$svn_ver/nutchez-0.2/src/package/$pac_name";
     90  if [ ! -e "$Install_Dir/package/$pac_name" ];then
     91    wget "http://nutchez.googlecode.com/files/$pac_name";
    9392    if [ $? -eq 0 ];then
    9493  mv $pac_name ./package;
     
    9998    fi
    10099  fi
    101   tar -zxvf ./package/$pac_name -C /opt/
     100  tar -zxvf $Install_Dir/package/$pac_name -C /opt/
    102101}
    103102
     
    416415
    417416function client_PassMasterIPAddr () {
    418   cd $Start_PATH
     417  cd $Work_Path
    419418  Line_NO=`cat client_install | grep -n '# Master IP here' | sed 's/:.*//g'`
    420419  debug_info "$MI_client_PassMasterIPAddr_echo_1"
     
    430429
    431430function client_PassMaster_Hostname () {
    432   cd $Start_PATH
     431  cd $Work_Path
    433432  Line_NO=`cat client_install | grep -n '# Master Hostname here' | sed 's/:.*//g'`
    434433  debug_info "$MI_client_PassMaster_Hostname_echo_1"
     
    443442
    444443function client_PassMasterIPAddr_for_Remove () {
    445   cd $Start_PATH
     444  cd $Work_Path
    446445  Line_NO=`cat client_remove.sh | grep -n "# Master IP here" | sed 's/:.*//g'`
    447446  sed -i ''$((Line_NO+1))'d' client_remove.sh
     
    468467  # 複製檔案至$User_HOME/source目錄下
    469468  mv NutchezForClientOf_$MasterIP_Address.tar.gz /home/nutchuser/nutchez/source
    470   cp $Start_PATH/client_install $Start_PATH/client_install_func.sh $Start_PATH/client_remove.sh $Start_PATH/lang_link  /home/nutchuser/nutchez/source
    471   cp -r $Start_PATH/lang /home/nutchuser/nutchez/source
    472   cp -r $Start_PATH/lang /home/nutchuser/nutchez/system
    473   cp $Start_PATH/nutchez $Start_PATH/lang_link $Start_PATH/add_hosts $Start_PATH/duplicate_del $Start_PATH/master_remove.sh /home/nutchuser/nutchez/system
    474 
    475 #  cp $Start_PATH/client_install $Start_PATH/client_install /home/nutchuser/nutchez/source
    476 #  cp $Start_PATH/client_install $Start_PATH/client_remove.sh /home/nutchuser/nutchez/source
    477 #  cp $Start_PATH/client_install $Start_PATH/lang* /home/nutchuser/nutchez/source
     469  cp $Work_Path/client_install $Work_Path/client_install_func.sh $Work_Path/client_remove.sh $Work_Path/lang_link  /home/nutchuser/nutchez/source
     470  cp -r $Work_Path/lang /home/nutchuser/nutchez/source
     471  cp -r $Work_Path/lang /home/nutchuser/nutchez/system
     472  cp $Work_Path/nutchez $Work_Path/lang_link $Work_Path/add_hosts $Work_Path/duplicate_del $Work_Path/master_remove.sh /home/nutchuser/nutchez/system
     473 
     474  # 複製 nutchez/source 到使用者的安裝資料夾
     475   
     476   mkdir $Install_Dir/Client_DIR
     477   cp -rf /home/nutchuser/nutchez/source/* $Install_Dir/Client_DIR/
     478   
     479#  cp $Work_Path/client_install $Work_Path/client_install /home/nutchuser/nutchez/source
     480#  cp $Work_Path/client_install $Work_Path/client_remove.sh /home/nutchuser/nutchez/source
     481#  cp $Work_Path/client_install $Work_Path/lang* /home/nutchuser/nutchez/source
    478482}
    479483
Note: See TracChangeset for help on using the changeset viewer.