Changeset 224 for nutchez-0.2


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

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

Location:
nutchez-0.2/src/shell
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/shell/client_install

    r220 r224  
    1818Linux_Version="";
    1919Nutchuser_Passwd="xxxxxxxxxx";
    20 Work_Path="./"
    21 Work_Path_J=0
    2220
     21Work_Path=`dirname "$0"`
     22
     23if [ -f $Work_Path/client_install_func.sh ];then
     24  Work_Path=`cd "$Work_Path"; pwd`
     25elif [ -f $Work_Path/bin/client_install_func.sh ];then
     26  Work_Path=`cd "$Work_Path/bin"; pwd`;
     27else
     28  echo "Import the installation libraries of client Error!!!"
     29  exit 1;
     30fi
     31
     32#Work_Path="./"
     33#Work_Path_J=0
    2334# Work Path Setup
    24 echo $0 | grep '/' || Work_Path_J=1
    25 if [ "$Work_Path_J" == "0"  ]; then
    26     Work_Path=$(echo $0 | sed 's/client_install//')
    27 fi
    28 # Source functions
    29 #if [ ! -f $Work_Path/client_install_func.sh ];then
    30 #  scp
     35#echo $0 | grep '/' || Work_Path_J=1
     36#if [ "$Work_Path_J" == "0"  ]; then
     37#    Work_Path=$(echo $0 | sed 's/client_install//')
    3138#fi
     39
    3240source $Work_Path/client_install_func.sh;
    33  
    3441
    3542# Language Choice
  • nutchez-0.2/src/shell/install

    r220 r224  
    44# 變數宣告
    55
    6 Work_Path="./"
    7 Work_Path_J=0
     6Work_Path=`dirname "$0"`
    87
    9 # Work Path setup
    10 echo $0 | grep '/' || Work_Path_J=1
    11 if [ "$Work_Path_J" == "0"  ]; then
    12     Work_Path=$(echo $0 | sed 's/install//')
    13 fi
    14 
    15 # Source functions
    16 if [ -f $Work_Path/install_func.sh ];then
    17   source $Work_Path/install_func.sh;
     8if [ -f $Work_Path/install_func.sh ];then
     9  Work_Path=`cd "$Work_Path"; pwd`
    1810elif [ -f $Work_Path/bin/install_func.sh ];then
    19   source $Work_Path/bin/install_func.sh;
     11  Work_Path=`cd "$Work_Path/bin"; pwd`;
    2012else
    2113  echo "Import install-function-library error !!! ";
     
    2315fi
    2416
    25 if [ -f $Work_Path/lang_linl ];then
     17#Work_Path=./
     18#Work_Path_J=0
     19# Work Path setup
     20#echo $0 | grep '/' || Work_Path_J=1
     21#if [ "$Work_Path_J" == "0"  ]; then
     22#    Work_Path=$(echo $0 | sed 's/install//')
     23#fi
     24
     25# Source functions
     26  source $Work_Path/install_func.sh;
    2627  source $Work_Path/lang_link;
    27 elif [ -f $Work_Path/bin/lang_link ];then
    28   source $Work_Path/bin/lang_link;
    29 else
    30   echo "Import Language-File error !!! ";
    31 fi
    3228### real code #####
    3329
     
    7672   
    7773    # 系統路徑鍊結
    78     ln -sf /home/nutchuser/nutchez/system/nutchez /usr/local/sbin/nutchez
     74    ln -sf /home/nutchuser/nutchez/system/nutchez /usr/local/bin/nutchez
    7975
    8076    make_client_install
  • 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
  • nutchez-0.2/src/shell/master_remove.sh

    r222 r224  
    6868# 移除檔案及資料夾
    6969function remove_folders () {
    70   rm /usr/local/sbin/nutchez
     70  rm /usr/local/bin/nutchez
    7171  show_info "$MR_remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..."
    7272  rm -rf /opt/nutchez
  • nutchez-0.2/src/shell/nutchez

    r219 r224  
    1818Tomcat_HOME="/opt/nutchez/tomcat"
    1919NutchEZ_HOME="/home/nutchuser/nutchez"
    20 Work_Path=
     20Work_Path=$NutchEZ_HOME/system
    2121
    2222#Work_Path="./"
Note: See TracChangeset for help on using the changeset viewer.