Changeset 205 for nutchez-0.2


Ignore:
Timestamp:
Jun 18, 2010, 9:21:07 AM (14 years ago)
Author:
shunfa
Message:

修改還原 /etc/hosts bug

Location:
nutchez-0.2/src/test
Files:
2 edited

Legend:

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

    r204 r205  
    6363  show_info "$edit_hosts_echo_1" # "修改/etc/hosts..."
    6464  Line_NO=`cat /etc/hosts | grep -n $Master_IP_Address | sed 's/:.*//g'`
    65   sed -i ''$Line_NO'd' /etc/hosts
     65  if [[ $Line_NO -ge 1 ]]; then
     66    sed -i ''$Line_NO'd' /etc/hosts
     67  fi
    6668  show_info "$edit_hosts_echo_2" # "完成修改/etc/hosts"
    6769}
  • nutchez-0.2/src/test/master_remove.sh

    r203 r205  
    6565function edit_hosts () {
    6666  show_info "$edit_hosts_echo_1" # "修改/etc/hosts..."
    67  
    6867  slaves_list=`cat $nutch_PATH'/nutch_nodes' | cut -d' ' -f1`
    6968  for nutch_node in $slaves_list
    7069  do
    7170    Line_NO=`cat /etc/hosts | grep -n $nutch_node | sed 's/:.*//g'`
    72     sed -i ''$Line_NO'd' /etc/hosts
     71    if [[ $Line_NO -ge 1 ]]; then
     72      sed -i ''$Line_NO'd' /etc/hosts
     73    fi
    7374  done
    7475  show_info "$edit_hosts_echo_2" # "完成修改/etc/hosts"
Note: See TracChangeset for help on using the changeset viewer.