发布新日志

  • A simple way to debug the bash script

    2008-11-12 16:56:12

    bash -x ./scrīpt.sh

  • installation script

    2008-11-12 16:49:53

    #Run this scrīpt to install panorama silently. You have to run it as root user.
    if [ "$(/usr/ucb/whoami)" != "root" ]; then
     echo "You must be root to execute this scrīpt." 2>&1
     exit 1
    fi

    if [ $# -ne 2 ]; then
     echo "Usage: $0 PanoramaVersion EMSType." 2>&1
     exit 1
    fi

    if [ "$2" != "ANSI" -a "$2" != "ETSI" ]; then
     echo "Usage: EMSType must be ANSI/ETSI." 2>&1
     exit 1
     else
       emsType=$2
    fi

    cd /
    # Check whether ems link file exists
    if [ ! -e "ems" ]; then
     echo "Lnks: ems not found. Please create a symbolic link named ems in root direcotry to Panorama installation directory." 2>&1
     exit 1
    fi

    emsVer="$1"
    cd ems
    emsDir="$(ls | grep "$emsVer")"
    if [ "$emsDir" = "" ]; then
     echo "Lnks: Panorama directory of "$emsVer" in "$(pwd)" not found."  2>&1
     exit 1
    fi

    # Unzip tar file
    cd $emsDir
    emsTar="$(ls | grep "$emsVer")"
    if [ "$emsTar" = "" ]; then
     echo "Lnks: Tar file of $emsVer in "$(pwd)" not found."  2>&1
     exit 1
    fi
    echo "Unzipping $emsTar..."
    gunzip -c "$emsTar" | tar -xvf -
    #rm "$emsTar"

    # Kick emsadmin user
    pkill -9 -u emsadmin

    # Install paronama full
    emsTypeFile="silentinstalloptions""$emsType"
    cp ../"$emsTypeFile" .
    ./silent_install.sh "$emsTypeFile"

    # Reboot
    echo "Reboot..."
    cd /
    #sync;sync;/etc/shutdown -y -g0 -i6

Open Toolbar