source: nutchez-0.2/src/shell/client_install @ 241

Last change on this file since 241 was 241, checked in by shunfa, 14 years ago

關閉選擇語言

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1#!/bin/bash
2# Program:
3#   Check root identity and change root to exectue client_install.sh
4# Author:
5#   Waue, Shunfa, Rock {waue, shunfa, rock}@nchc.org.tw
6# History:
7#   2010/05/20  Rock    First release
8
9# 正式版之後,記的將不必要 read 拿掉 (trace 用的 read)
10
11# 需要 master_install 設定的參數區
12# Master IP here
13Master_IP_Address=140.110.138.192
14# Master Hostname here
15Master_Hostname=u1004
16# 此檔自己用的參數區
17Linux_Distribution="";
18Linux_Version="";
19Nutchuser_Passwd="xxxxxxxxxx";
20
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
34# Work Path Setup
35#echo $0 | grep '/' || Work_Path_J=1
36#if [ "$Work_Path_J" == "0"  ]; then
37#    Work_Path=$(echo $0 | sed 's/client_install//')
38#fi
39
40source $Work_Path/client_install_func.sh;
41
42# 載入系統預設的語言
43load_default_lang
44# 檢查執行這個程式的是否為root權限
45
46check_root
47read -p "continue.."
48
49# Language Choice
50#choose_lang
51
52# 參數詢問
53yesno="no"
54show_info "$par_echo_1 $Master_IP_Address"
55read -p "$par_echo_2" yesno
56             
57if [ "$yesno" == "yes" ] || [ "$yesno" == "y" ] ; then
58    show_info "$par_echo_3"
59else
60    show_info "$par_echo_4"
61    exit
62fi
63
64
65# 檢查執行這個程式的是否為root權限
66#check_root
67#read -p "continue.."
68
69# 查出此主機的作業系統,以及版本
70check_systemInfo
71read -p "continue.."
72
73# 安裝需要的套件 (目前只支援 deb 套件的系統自動安裝,yum或其他套件系統的則必須手動安裝)
74# 需要套件名稱 ssh, expect, dialog
75install_packages
76read -p "continue.."
77
78# 檢查之前是否有安裝NutchEz
79# 目前先檢查是否有/opt/nutchez 這個資料夾即可
80check_nez_installed
81read -p "continue.."
82
83# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
84check_sunJava
85read -p "continue.."
86
87# 檢查是否有安裝openssh, openssh-server
88check_ssh
89read -p "continue.."
90
91# 檢查是否有安裝dialog
92check_dialog
93read -p "continue.."
94
95# 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
96creat_nutchuser_account
97read -p "continue.."
98
99# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
100# 當使用者輸入nutchuser 密碼時,將此密碼紀錄到Nutchuser_Passwd
101# 此步驟若無法連到 master 則跳出
102scp_master_nutchuser_sshkey $Master_IP_Address
103read -p "continue.."
104
105# 用scp 複製 master 的設定與安裝資料
106# 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
107scp_packages $Master_IP_Address
108read -p "continue.."
109
110# 安裝及啟動
111install_nutch_package
112read -p "continue.."
113
114# 回覆 Hostname 和 IP 給 Master Server
115recall_hostname_ip $Master_IP_Address
116show_info "$CI_finish_echo_1"
117read -p "continue.."
Note: See TracBrowser for help on using the repository browser.