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

Update 3 functions (check_ssh, check_dialog, check_php)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.