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

Last change on this file since 213 was 213, checked in by shunfa, 14 years ago
  1. 修改master_install source 語言鏈結
  2. 修改移除時, 還原/etc/hosts至安裝NutchEZ前的版本
  3. 修改中文語言檔對應的變數
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2#
3
4# 變數宣告
5Work_Path="./"
6Work_Path_J=0
7
8# Work Path setup
9echo $0 | grep '/' || Work_Path_J=1
10if [ "$Work_Path_J" == "0"  ]; then
11    Work_Path=$(echo $0 | sed 's/install//')
12fi
13
14# Source functions
15source $Work_Path/install_func.sh
16source $Work_Path/lang_link
17### real code #####
18
19# 前置作業
20# *.sh及nutchez-0.2-0531.tar.gz均在同一目錄下
21
22function show_info () {
23  if [ $? -eq 0 ]; then
24    echo -e "\033[1;32;40m $1 \033[0m"
25  fi
26}
27
28main () {
29  check_info
30  show_info "$MI_main_echo_1"
31# show_info "歡迎使用NutchEZ, 此安裝程序會為您新建一個nutchuser帳號並協助您設定密碼"
32  set_install_information
33  show_master_info
34  read -p "$MI_main_echo_2" confirm
35# read -p "Please confirm your install infomation: 1.Yes 2.No  " confirm
36  if [ $confirm -eq 1 ]; then
37    creat_nutchuser_account $Nutchuser_Passwd
38    make_ssh_key
39    # 解壓縮
40    tar -zxvf nutchezV2-current.tar.gz -C /opt/
41
42    su nutchuser -c "mkdir /home/nutchuser/nutchez"
43    su nutchuser -c "mkdir /home/nutchuser/nutchez/urls"
44    su nutchuser -c "touch /home/nutchuser/nutchez/urls/urls.txt"
45    su nutchuser -c "mkdir /home/nutchuser/nutchez/search"
46    su nutchuser -c "mkdir /home/nutchuser/nutchez/source"
47    su nutchuser -c "mkdir /home/nutchuser/nutchez/system"   
48
49    Install_Nutch
50
51    mkdir /var/nutchez
52    chown -R nutchuser:nutchuser /opt/nutchez
53    chown -R nutchuser:nutchuser /var/nutchez
54
55    make_client_install
56    # 啟動系統
57    format_HDFS
58    start_up_NutchEZ
59    start_up_tomcat   
60    # 安裝流程結束,並進入網頁管理頁面設定爬網網址...等 
61    show_info "$MI_main_echo_3"
62#   show_info "Install Successfully!!"
63    show_info "$MI_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.