Ignore:
Timestamp:
Jun 10, 2010, 3:14:50 PM (14 years ago)
Author:
rock
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • nutchez-0.2/src/test/nutchez

    r176 r177  
    6464$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" \
    6565    --title "[Management Options]" \
    66         --menu "Plz choose: " 15 55 6 \
     66        --menu "Plz choose: " 15 60 6 \
    6767        "cluster_status" "Check cluster status" \
    6868        "cluster_setup" "Setup your datanode & tasktracker" \
     
    122122$DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC =" \
    123123    --title "[Management Options]" \
    124     --menu "Plz choose: " 15 55 2 \
     124    --menu "Plz choose: " 15 55 3 \
    125125    "All" "All nodes" \
    126     "Part" "choose part nodess" 2>$allpart
     126    "Part" "Choose part nodess" \
     127    "Exit" "Exit" 2>$allpart
    127128
    128129# 判斷是否選 all 和 part,若是 all 直接到服務選單,若是 part 則先到機器選單
    129 if [ $(cat $allpart) == "All" ]; then
     130if [ "$(cat $allpart)" == "All" ]; then
    130131     cat $NutchEZ_HOME/system/nutch_nodes | grep -v '^$' | grep -v '#'  | awk '{print $1}' >$runNodes
    131 else
     132elif [ "$(cat $allpart)" == "Part" ]; then
    132133    $DIALOG --clear --backtitle "= [NutchEz Management Interface] ~by NCHC  = " --title "[Datanode & Tasktracker Nodes Choose]" \
    133     --checklist "datanode & tasktracker choose: " 15 55 7 $(cat  $NutchEZ_HOME/system/nutch_nodes | \
     134    --checklist "datanode & tasktracker choose: " 15 55 7 $(cat $NutchEZ_HOME/system/nutch_nodes | \
    134135    grep -v '^$' | grep -v '#'  | awk '{print $1 "\t" $2 "\t" "$LIST_status" }') 2>$runNodes
     136else
     137    exit
     138fi
     139
     140if [ -z "$(cat $runNodes)" ]; then
     141exit
    135142fi
    136143
     
    160167        [ $? == "0" ] || echo "Can't ssh to $node !!!"
    161168    done
    162 else
     169elif [ "$(cat $clusterSetup)" == "restart"  ]; then
    163170    echo -e "\n[Restart datanode & tasktracker]"
    164171    for node in $(cat $runNodes)
     
    166173        echo -e "restart $node datanode & tasktracker !"
    167174        ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop datanode \
    168         ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker"
    169         ssh -o StrictHostKeyChecking=no $node "$NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \
     175        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh stop tasktracker \
     176        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start datanode \
    170177        ; $NutchEZ_Install_PATH/nutch/bin/hadoop-daemon.sh start tasktracker"
    171178        [ $? == "0" ] || echo "Can't ssh to $node !!!"
    172179    done
    173  
     180else
     181    exit
    174182fi
    175183}
     
    194202        "restart" "Restart tomcat" \
    195203        "exit" "Exit" 2>$tomcatSwitch
     204
     205if [ "$(cat $tomcatSwitch)" == "exit" ]; then
     206    exit 0
     207fi
     208
     209# jude $Tomcat_HOME/bin/startup.sh
     210if [ ! -e $Tomcat_HOME/bin/startup.sh ]; then
     211    echo -e "\nDon't fine $Tomcat_HOME/bin/startup.sh"
     212    exit
     213fi
     214
     215if [ ! -e $Tomcat_HOME/bin/shudown.sh ]; then
     216    echo -e "\nDon't fine $Tomcat_HOME/bin/shudown.sh"
     217    exit
     218fi
    196219
    197220if [ "$(cat $tomcatSwitch)" == "start" ]; then
     
    222245    --inputbox "Plz input port number for tomcat (default is 8080)" 10 55 2>$tomcatPort
    223246
    224 if [ -z $(cat $tomcatPort) ]; then
     247if [ -z "$(cat $tomcatPort)" ]; then
    225248    exit
    226249else
     
    242265    --menu "Plz choose: " 15 55 3 \
    243266    "English" "English" \
    244     "Chinese" "Chinese" 2>$langSwitch
     267    "Chinese" "Chinese" \
     268    "Exit" "Exit" 2>$langSwitch
    245269#
    246 echo "source $(cat $langSwitch)"
     270if [ "$(cat $langSwitch)" == "Exit" ]; then
     271    exit
     272else
     273    echo "source $(cat $langSwitch)"
     274fi
    247275}
    248276
Note: See TracChangeset for help on using the changeset viewer.