Changeset 224
- Timestamp:
- Jun 25, 2010, 2:24:39 PM (15 years ago)
- Location:
- nutchez-0.2/src/shell
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.2/src/shell/client_install
r220 r224 18 18 Linux_Version=""; 19 19 Nutchuser_Passwd="xxxxxxxxxx"; 20 Work_Path="./"21 Work_Path_J=022 20 21 Work_Path=`dirname "$0"` 22 23 if [ -f $Work_Path/client_install_func.sh ];then 24 Work_Path=`cd "$Work_Path"; pwd` 25 elif [ -f $Work_Path/bin/client_install_func.sh ];then 26 Work_Path=`cd "$Work_Path/bin"; pwd`; 27 else 28 echo "Import the installation libraries of client Error!!!" 29 exit 1; 30 fi 31 32 #Work_Path="./" 33 #Work_Path_J=0 23 34 # 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//') 31 38 #fi 39 32 40 source $Work_Path/client_install_func.sh; 33 34 41 35 42 # Language Choice -
nutchez-0.2/src/shell/install
r220 r224 4 4 # 變數宣告 5 5 6 Work_Path="./" 7 Work_Path_J=0 6 Work_Path=`dirname "$0"` 8 7 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; 8 if [ -f $Work_Path/install_func.sh ];then 9 Work_Path=`cd "$Work_Path"; pwd` 18 10 elif [ -f $Work_Path/bin/install_func.sh ];then 19 source $Work_Path/bin/install_func.sh;11 Work_Path=`cd "$Work_Path/bin"; pwd`; 20 12 else 21 13 echo "Import install-function-library error !!! "; … … 23 15 fi 24 16 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; 26 27 source $Work_Path/lang_link; 27 elif [ -f $Work_Path/bin/lang_link ];then28 source $Work_Path/bin/lang_link;29 else30 echo "Import Language-File error !!! ";31 fi32 28 ### real code ##### 33 29 … … 76 72 77 73 # 系統路徑鍊結 78 ln -sf /home/nutchuser/nutchez/system/nutchez /usr/local/ sbin/nutchez74 ln -sf /home/nutchuser/nutchez/system/nutchez /usr/local/bin/nutchez 79 75 80 76 make_client_install -
nutchez-0.2/src/shell/install_func.sh
r219 r224 1 1 #!/bin/bash 2 #source $Work_Path/lang_link3 2 4 3 # shell檔及壓縮檔在同一目錄中 … … 10 9 Index_DB=$User_HOME/search 11 10 Admin_email=nutchuser@nutch 12 Start_PATH=`pwd` 11 # Work_Path=(define on install) 12 Install_Dir=$Work_Path/../ 13 13 MasterIP_Address=`/sbin/ifconfig eth0 | grep 'inet addr' | sed 's/^.*addr://g' | sed 's/Bcast.*$//g' | sed 's/ .*// '` 14 14 net_MacAddr=`/sbin/ifconfig eth0 | grep 'HW' | sed 's/^.*HWaddr //g'` … … 85 85 function unzip_nV2_pack(){ 86 86 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 89 88 mkdir ./package 90 89 fi 91 if [ ! -e " ./package/$pac_name" ];then92 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"; 93 92 if [ $? -eq 0 ];then 94 93 mv $pac_name ./package; … … 99 98 fi 100 99 fi 101 tar -zxvf ./package/$pac_name -C /opt/100 tar -zxvf $Install_Dir/package/$pac_name -C /opt/ 102 101 } 103 102 … … 416 415 417 416 function client_PassMasterIPAddr () { 418 cd $ Start_PATH417 cd $Work_Path 419 418 Line_NO=`cat client_install | grep -n '# Master IP here' | sed 's/:.*//g'` 420 419 debug_info "$MI_client_PassMasterIPAddr_echo_1" … … 430 429 431 430 function client_PassMaster_Hostname () { 432 cd $ Start_PATH431 cd $Work_Path 433 432 Line_NO=`cat client_install | grep -n '# Master Hostname here' | sed 's/:.*//g'` 434 433 debug_info "$MI_client_PassMaster_Hostname_echo_1" … … 443 442 444 443 function client_PassMasterIPAddr_for_Remove () { 445 cd $ Start_PATH444 cd $Work_Path 446 445 Line_NO=`cat client_remove.sh | grep -n "# Master IP here" | sed 's/:.*//g'` 447 446 sed -i ''$((Line_NO+1))'d' client_remove.sh … … 468 467 # 複製檔案至$User_HOME/source目錄下 469 468 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 478 482 } 479 483 -
nutchez-0.2/src/shell/master_remove.sh
r222 r224 68 68 # 移除檔案及資料夾 69 69 function remove_folders () { 70 rm /usr/local/ sbin/nutchez70 rm /usr/local/bin/nutchez 71 71 show_info "$MR_remove_folders_echo_1" # "正在刪除安裝時所建立的檔案及資料夾..." 72 72 rm -rf /opt/nutchez -
nutchez-0.2/src/shell/nutchez
r219 r224 18 18 Tomcat_HOME="/opt/nutchez/tomcat" 19 19 NutchEZ_HOME="/home/nutchuser/nutchez" 20 Work_Path= 20 Work_Path=$NutchEZ_HOME/system 21 21 22 22 #Work_Path="./"
Note: See TracChangeset
for help on using the changeset viewer.