Changeset 123


Ignore:
Timestamp:
May 21, 2010, 5:35:16 PM (15 years ago)
Author:
rock
Message:

Update 3 functions (check_ssh, check_dialog, check_php)

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

Legend:

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

    r122 r123  
    77#   2010/05/20  Rock    First release
    88
     9# 正式版之後,記的將不必要 read 拿掉 (trace 用的 read)
    910
    1011# 設定 functions
     
    2829read
    2930
    30 # 查出此主機的作業系統,以及版本,後面 read 在正式版後會拿掉 (用來trace 用)
     31# 查出此主機的作業系統,以及版本
    3132check_systemInfo
    3233read
     
    3940# 檢查是否有安裝sun java ,並檢查是否為jdk 1.6 以上版本
    4041check_sunJava
     42#read
     43
     44# 檢查是否有安裝openssh, openssh-server
     45check_ssh
    4146read
    4247
    43 # 檢查是否有安裝openssh, openssh-server
    44 #check_ssh
    45 
    46 # 檢查是否有安裝cdialog
    47 #check_dialog
     48# 檢查是否有安裝dialog
     49check_dialog
     50read
    4851
    4952# 檢查是否安裝 php 5.5
    50 #check_php
     53check_php
     54read
    5155
    5256# scp nutchuser@master_ip:~ 把.ssh/目錄複製下來
  • nutchez-0.2/src/test/client_install_func.sh

    r122 r123  
    77#   2010/05/20  Rock    First release(0.1)
    88
     9# 正式版之後,記的將不必要的 echo 拿掉
     10
     11
     12# 檢查執行這個程式的是否為root權限
    913function check_root(){
     14# 正式版後可拿掉此 echo
    1015echo -e "\n= check_root ="
    1116if [ $USER != "root" ]; then
     
    1318    exit
    1419fi
     20# 正式版後可拿掉此 echo
     21echo -e "Identify is root."
    1522}
    16 
    1723
    1824
     
    4248javaPath="/usr/"
    4349
    44 test -e $javaPath/bin/java || read -p "Plz input your specific Java path\
     50test -e $javaPath/bin/java || read -p "Plz input specific Java path\
    4551(ex./opt/jvm/java-6-sun-1.6.0.20/): " javaPath
    4652
     
    5157
    5258    if [ "$JAVA_org" == "" ]; then
    53         echo "Your Java is not Sun version, plz install sun Java 1.6.X"
     59        echo "Java is not Sun version, plz install sun Java 1.6.X"
    5460        exit   
    5561    fi
    5662   
    5763    if [ $JAVA_version -lt "1.6" ]; then
    58         echo "Your Java version is too old (it need 1.6.X above)"
     64        echo "Java version is too old (it need 1.6.X above)"
    5965        exit
    6066    fi
     
    6773unset JAVA_org
    6874unset JAVA_version
     75}
    6976
     77
     78# 檢查是否有安裝openssh, openssh-server
     79function check_ssh(){
     80echo -e "\n= check_ssh ="
     81if [ -e /usr/bin/ssh ]; then
     82    echo -e "\nSystem has ssh."
     83else
     84    echo "Plz install ssh."
     85    exit
     86fi
     87
     88if [ -e /usr/sbin/sshd ]; then
     89    echo "System has ssh Server (sshd)."
     90else
     91    echo "Plz install ssh Server (sshd)."
     92    exit
     93fi
    7094}
     95
     96
     97# 檢查是否有安裝dialog
     98function check_dialog(){
     99echo -e "\n= check_dialog ="
     100if [ -e /usr/bin/dialog ]; then
     101    echo -e "\nSystem has dialog."
     102else
     103    echo "Plz install dialog."
     104    exit
     105fi
     106}
     107
     108
     109# 檢查是否安裝 php 5.5
     110function check_php(){
     111echo -e "\n= check_php ="
     112if [ "$(php -v 2>/dev/null | grep "PHP 5" | awk '{print $2}' | cut -d "." -f1)" == 5 ]; then
     113    echo -e "\nPHP'version is 5"
     114else
     115    echo -e "\nplz  install PHP 5 version"
     116#    exit
     117fi
     118}
Note: See TracChangeset for help on using the changeset viewer.