source: nutchez-0.2/src/test/install @ 198

Last change on this file since 198 was 198, checked in by rock, 14 years ago

修改 install 工作路徑變數

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2# 語言的選擇
3# source ./language_choise.sh
4# 匯入功能函數
5source ./install_func.sh
6#source ./client_install_func.sh
7source ./install_lang.zh
8
9Work_Path="./"
10Work_Path_J=0
11
12# Work Path setup
13echo $0 | grep '/' || Work_Path_J=1
14if [ "$Work_Path_J" == "0"  ]; then
15    Work_Path=$(echo $0 | sed 's/install//')
16fi
17
18# Source functions
19source $Work_Path/client_install_func.sh
20### real code #####
21
22# 前置作業
23# *.sh及nutchez-0.2-0531.tar.gz均在同一目錄下
24
25function show_info () {
26  if [ $? -eq 0 ]; then
27    echo -e "\033[1;32;40m $1 \033[0m"
28  fi
29}
30
31main () {
32  check_info
33  show_info $main_echo_1
34# show_info "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼"
35  set_install_information
36  read -p "$main_echo_2" confirm
37# read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
38  if [ $confirm -eq 1 ]; then
39    creat_nutchuser_account $Nutchuser_Passwd
40    make_ssh_key
41   
42    # 解壓縮
43    tar -zxvf nutchezV2-current.tar.gz -C /opt/
44    Install_Nutch
45    mkdir /var/nutchez
46    chown -R nutchuser:nutchuser /opt/nutchez
47    chown -R nutchuser:nutchuser /var/nutchez
48    su nutchuser -c "mkdir /home/nutchuser/nutchez"
49    su nutchuser -c "mkdir /home/nutchuser/nutchez/urls"
50    su nutchuser -c "touch /home/nutchuser/nutchez/urls/urls.txt"
51    su nutchuser -c "mkdir /home/nutchuser/nutchez/search"
52    su nutchuser -c "mkdir /home/nutchuser/nutchez/source"
53    su nutchuser -c "mkdir /home/nutchuser/nutchez/system"
54    make_client_install
55
56    # 啟動系統
57    format_HDFS
58    start_up_NutchEZ
59    start_up_tomcat   
60    # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 
61    show_info $main_echo_3
62#   show_info "Install Successfully!!"
63    show_info $main_echo_4
64#   show_info "Visit http://$MasterIP_Address:8080"
65    client_install_commands
66  elif [ $confirm -eq 2 ]; then
67    main
68  fi
69}
70
71main
Note: See TracBrowser for help on using the repository browser.