Changeset 126


Ignore:
Timestamp:
May 24, 2010, 4:07:06 PM (14 years ago)
Author:
shunfa
Message:

commit test/install_func.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/test/install_func.sh

    r125 r126  
    114114}
    115115
    116 ###################
    117 # undo... sed or cp
     116
    118117set_crawl-urlfilter () {
    119118  echo "set NutchEZ_HOME/conf/set_crawl-urlfilter.txt"
     119  Line_NO=`cat '$NutchEZ'/conf/crawl-urlfilter.txt | grep -n 'skip URLs containing certain characters as probable queries, etc.' | sed 's/:.*//g'`
     120  sed -i ''$((Line_NO+1))'d' $NutchEZ/conf/crawl-urlfilter.txt
     121  sed -i ''$Line_NO'a -[*!@]' $NutchEZ/conf/crawl-urlfilter.txt
     122  Line_NO=`cat crawl-urlfilter.txt | grep -n 'accept hosts in MY.DOMAIN.NAME' | sed 's/:.*//g'`
     123  sed -i ''$((Line_NO+1))'d' $NutchEZ/conf/crawl-urlfilter.txt
     124  sed -i ''$Line_NO'a +^http://([a-z0-9]*\.)*.*/' $NutchEZ/conf/crawl-urlfilter.txt
    120125}
    121126
     
    145150}
    146151
    147 ####################
    148 # undo...sed or cp
    149152set_server () {
    150153  echo "$NutchEZ_HOME/tomcat/conf/server.xml"
     154  Line_NO=`cat '$NutchEZ'/tomcat/conf/server.xml | grep -n '<Connector port="8080" protocol="HTTP/1.1"' | sed 's/:.*//g'`
     155  sed -i ''$Line_NO','$(($Line_NO+2))'d' server.xml
     156  sed -i ''$Line_NO'a <Connector port="8080" protocol="HTTP/1.1"\
     157               connectionTimeout="20000"\
     158               redirectPort="8443" URIEncoding="UTF-8"/>\
     159' $NutchEZ/tomcat/conf/server.xml
    151160}
    152161
    153 ####################
    154 # undo...sed or cp
     162
    155163set_nutch-site () {
    156164  echo "$NutchEZ_HOME/tomcat/webapps/ROOT/WEB-INF/classes/nutch-site.xml"
     165 
     166  # 搜尋加入設定的行號位址
     167  line_NO=`cat '$NutchEZ'/conf/nutch-site.xml | grep -n '<'configuration'>' | sed 's/:.*//g'`
     168 
     169  # 加入設定檔
     170  sed -i ''$line_NO'a <property>\
     171  <name>http.agent.name</name>\
     172  <value>waue</value>\
     173  <description>HTTP 'User-Agent' request header. </description>\
     174</property>\
     175<property>\
     176  <name>http.agent.description</name>\
     177  <value>MyTest</value>\
     178  <description>Further description</description>\
     179</property>\
     180<property>\
     181  <name>http.agent.url</name>\
     182  <value>'$MasterDNS'</value>\
     183  <description>A URL to advertise in the User-Agent header. </description>\
     184</property>\
     185<property>\
     186  <name>http.agent.email</name>\
     187  <value>'$Admin_email'</value>\
     188  <description>An email address\
     189  </description>\
     190</property>\
     191' $NutchEZ/conf/nutch-site.xml
    157192}
    158193
Note: See TracChangeset for help on using the changeset viewer.