Last change
on this file since 87 was
77,
checked in by waue, 15 years ago
|
good
|
-
Property svn:executable set to
*
|
File size:
1.6 KB
|
Rev | Line | |
---|
[66] | 1 | #!/bin/bash |
---|
| 2 | # Author: WeiYu Chen <waue _at_ nchc org tw> |
---|
| 3 | # License: GPL |
---|
| 4 | # Description: Eazily use for Nutch |
---|
| 5 | # . |
---|
| 6 | |
---|
[69] | 7 | # begining .. |
---|
[67] | 8 | |
---|
[72] | 9 | #bin=`dirname "$0"` |
---|
| 10 | #bin=`cd "$bin"; pwd` |
---|
| 11 | |
---|
| 12 | #. "$bin"/nutchez-func.sh |
---|
| 13 | |
---|
| 14 | export NUTCH_CONF_DIR=~/.nutchez |
---|
| 15 | export HADOOP_CONF_DIR=~/.nutchez |
---|
[75] | 16 | export NUTCH_LOG_DIR=~/.nutchez/log |
---|
[77] | 17 | |
---|
| 18 | if [ $JAVA_HOME = "" ];then |
---|
| 19 | export JAVA_HOME=/usr/lib/jvm/java-6-sun |
---|
| 20 | fi |
---|
| 21 | |
---|
[75] | 22 | # export NUTCH_HOME=/opt/nutch |
---|
[72] | 23 | |
---|
| 24 | . /opt/nutch/bin/nutchez-func.sh |
---|
[77] | 25 | #. ~/.nutchez/hadoop-env.sh |
---|
[72] | 26 | |
---|
| 27 | |
---|
| 28 | |
---|
[69] | 29 | init_nutchez |
---|
[68] | 30 | |
---|
[66] | 31 | CHECK=0 |
---|
| 32 | while [ $CHECK -eq 0 ]; do |
---|
| 33 | |
---|
| 34 | LOCK=1 |
---|
| 35 | while [ $LOCK -eq 1 ]; do |
---|
| 36 | # milestone M1 |
---|
| 37 | show_urls |
---|
| 38 | URL=$? |
---|
| 39 | echo_vb "2.2 show_urls return $URL" |
---|
| 40 | |
---|
| 41 | # add or delete url: ok , exit |
---|
| 42 | # ok =0 , exit =1 |
---|
| 43 | |
---|
| 44 | if [ $URL -eq 0 ];then |
---|
| 45 | # go_to_M2 |
---|
| 46 | LOCK=0 |
---|
| 47 | else |
---|
| 48 | #return_console |
---|
| 49 | exit |
---|
| 50 | fi |
---|
| 51 | |
---|
| 52 | done |
---|
| 53 | # milestone M2 |
---|
| 54 | |
---|
| 55 | # setup search engine personality |
---|
| 56 | # next, back |
---|
| 57 | setup_robot |
---|
| 58 | |
---|
| 59 | # setup the crawl paramater |
---|
| 60 | # next, back |
---|
| 61 | setup_crawler |
---|
| 62 | |
---|
| 63 | # setup the tomcat paramater |
---|
| 64 | # next, back |
---|
| 65 | setup_tomcat |
---|
| 66 | |
---|
| 67 | # show the final checklist |
---|
| 68 | final_confirm |
---|
| 69 | FC=$? |
---|
| 70 | echo_vb "6.3 final confirm return = $FC " |
---|
| 71 | # START , back, cancel |
---|
| 72 | # start =0 , back =1 |
---|
[75] | 73 | #if [ $FC -eq 0 ];then |
---|
| 74 | case $FC in |
---|
| 75 | 0) |
---|
| 76 | #go_to_M3 |
---|
| 77 | CHECK=1 |
---|
| 78 | # change temp file as conf file |
---|
| 79 | promote_tempfile |
---|
| 80 | ;; |
---|
| 81 | #else |
---|
| 82 | 1) |
---|
| 83 | exit |
---|
| 84 | ;; |
---|
| 85 | 3) |
---|
| 86 | #go_to_M1 |
---|
| 87 | LOCK=1 |
---|
| 88 | CHECK=0 |
---|
| 89 | # temp file delete! |
---|
| 90 | clean_tempfile |
---|
| 91 | #return_console |
---|
| 92 | ;; |
---|
| 93 | 255) |
---|
| 94 | echo_vb "ESC pressed !!" |
---|
| 95 | ;; |
---|
| 96 | esac |
---|
| 97 | #fi |
---|
[66] | 98 | done |
---|
| 99 | |
---|
[77] | 100 | set_nutchez_p |
---|
| 101 | |
---|
[66] | 102 | start_crawl |
---|
| 103 | |
---|
[77] | 104 | start_tomcat |
---|
[66] | 105 | |
---|
| 106 | # show result message |
---|
| 107 | |
---|
[77] | 108 | show_report |
---|
[66] | 109 | |
---|
| 110 | # Done |
---|
| 111 | |
---|
Note: See
TracBrowser
for help on using the repository browser.