Changeset 94 for nutchez-0.1/bin/nutchez
- Timestamp:
- Jul 8, 2009, 2:20:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nutchez-0.1/bin/nutchez
r91 r94 12 12 export JAVA_HOME=/usr/lib/jvm/java-6-sun 13 13 export NUTCH_HOME=/opt/nutch 14 # export HADOOP_HOME=/opt/nutch15 14 export NUTCH_CONF_DIR=~/.nutchez/conf 16 # export HADOOP_CONF_DIR=~/.nutchez/conf17 15 export NUTCH_LOG_DIR=~/.nutchez/log 18 16 17 . /opt/nutch/bin/nutchez-func.sh 18 19 init_nutchez 19 20 20 21 22 tfile=`tempfile 2>/dev/null` || tfile=/tmp/test$$ 23 trap "rm -f $tfile" 0 1 2 5 15 21 24 22 . /opt/nutch/bin/nutchez-func.sh 23 #. ~/.nutchez/hadoop-env.sh 25 $DIALOG --backtitle "Developed By NCHC" --clear --item-help --title "NutchEz 雛型版" \ 26 --menu " 你好,歡迎使用NutchEz! \n\ 27 這套軟體是用來打造專屬於你的搜尋引擎 \n\ 28 你有網頁不希望被公開的搜尋引擎找到, \n\ 29 卻又希望能有個搜尋介面的困擾嗎? \n\ 30 用NutchEz就對了!因為他操作簡單, \n\ 31 除了基本的網頁以外,還支援多種格式(ppt,doc,txt...) \n\ 32 並且是開源碼軟體,完全免費,安全無虞\n\ 33 趕快來使用看看吧!\n\n\ 34 選擇你要的模式:" 20 60 4 \ 35 "1" "開始建構搜尋內容" "透過NutchEz來建構專屬於你自己所需的內容的搜尋引擎" \ 36 "2" "開啟或關閉NutchEz的網頁伺服器" "若您之前已經執行完1之後才需做網頁伺服器的管理" 2> $tfile 24 37 38 rev=$? 25 39 40 MAIN_CHOISE=`cat $tfile` 26 41 27 init_nutchez 42 case $rev in 43 0) 44 echo_dialog_v "OK '$MAIN_CHOISE' chosen.";; 45 1) 46 echo_dialog_v "Cancel pressed." 47 exit 0 ;; 48 2) 49 echo_dialog_v "HELP '$MAIN_CHOISE' chosen.";; 50 255) 51 echo_dialog_v "ESC pressed.";; 52 *) 53 echo_dialog_v "Unexpected code $MAIN_CHOISE";; 54 esac 55 56 if [ $MAIN_CHOISE -eq 2 ];then 57 58 pid_tc=$(ps axw -eo pid,command |\ 59 grep "catalina" | grep "java" |\ 60 grep "start" | awk '{print $1}') 61 if [ -z "$pid_tc" ]; then 62 echo_dialog_v "0. pid = $pid_tc ! no another toddmcat is running" 63 64 $DIALOG --title "你的NutchEz網頁伺服器沒打開.." --clear \ 65 --yesno "\n 要開啟NutchEz的網頁伺服器嗎? \n" 15 61 66 if [ $? -eq 0 ];then 67 ~/.nutchez/tomcat/bin/startup.sh 68 PORT=`cat ~/.nutchez/sav/n.tomcat.txt` 69 $DIALOG --msgbox "已經試著開啟瀏覽伺服器,你可以瀏覽這個網址看看: \n http://localhost:$PORT" 0 0 70 else 71 $DIALOG --msgbox "你選擇不要打開瀏覽伺服器!" 0 0 72 fi 73 74 else 75 echo_dialog_v "0. tomcat had been started and the pid is $pid_tc" 76 77 $DIALOG --title "偵測到NutchEz的網頁伺服器正在運作.." --clear \ 78 --yesno "\n 你要關閉他嗎? \n" 15 61 79 if [ $? -eq 0 ];then 80 ~/.nutchez/tomcat/bin/shutdown.sh 81 kill -9 $pid_tc 82 $DIALOG --msgbox "已經試著關閉NutchEz網頁伺服器" 0 0 83 else 84 $DIALOG --msgbox "你選擇不要關閉瀏覽伺服器!" 0 0 85 fi 86 87 fi 88 exit 0 89 90 elif [ $MAIN_CHOISE -eq 1 ];then 28 91 29 92 CHECK=0 … … 35 98 show_urls 36 99 URL=$? 37 echo_ vb"2.2 show_urls return $URL"100 echo_dialog_v "2.2 show_urls return $URL" 38 101 39 102 # add or delete url: ok , exit … … 63 126 setup_tomcat 64 127 128 # continue last search 129 if [ -e ~/.nutchez/search ];then 130 continue_previous 131 fi 65 132 # show the final checklist 66 133 final_confirm 67 134 FC=$? 68 echo_ vb"6.3 final confirm return = $FC "135 echo_dialog_v "6.3 final confirm return = $FC " 69 136 # START , back, cancel 70 137 # start =0 , back =1 … … 90 157 ;; 91 158 255) 92 echo_ vb"ESC pressed !!"159 echo_dialog_v "ESC pressed !!" 93 160 ;; 94 161 esac … … 108 175 # Done 109 176 177 178 179 180 else 181 182 echo_dialog_v "Main Choise is $MAIN_CHOISE ! Error !!" 183 184 fi
Note: See TracChangeset
for help on using the changeset viewer.