Script Question

From: Fiengo, Paul (Contractor) (FiengoP_at_ritchie.disa.mil)
Date: 11/25/03

  • Next message: Andrew Luande ALT: "Advice on slice and raid5"
    To: "'sunmanagers@sunmanagers.org'" <sunmanagers@sunmanagers.org>
    Date: Tue, 25 Nov 2003 12:17:29 -0500
    
    

    All Gurus and Gurettes:

    I am having an issue with a script that I am writing. For some reason my
    "&&" operation is not working properly and I do not know why. If either
    condition exists, the result of the expression is returning true whereas it
    should be false. That is my understanding anyway. Can someone please tell
    me what I am doing wrong. I have tried different test operators such as ((
    )), or [[ ]] which output different results. (Bad number) Not sure what
    that is. I am running Solaris 8 02/02 on an E250. My patch cluster is a
    month old (108528-24). Any assistance would be greatly appreciated.

    if test "`ps -ef | grep /oob-in/security/logs/NT/ascii | grep -v grep && ps
    -ef | grep /oob-in/security/logs/NT/binary | grep -v grep`"

                    then

                    if [ -f $CONLOCK ]

                            then

                            else touch $CONLOCK

                    fi
                            else echo `date` "icsspdchk-co... The ICSSPD Daemon
    is not running. Removing the condition lock file. Attempting to start the
    ICSSPD Daemon." >> $ASERRLOG

                            rm $CONLOCK

                            /etc/init.d/icsspd.A start >> $ASERRLOG

                            /etc/init.d/icsspd.B start >> $ASERRLOG

                            if test "` ps -ef | grep
    /oob-in/security/logs/NT/ascii | grep -v grep && ps -ef | grep
    /oob-in/security/logs/NT/binary | grep -v grep`"

                                    then

                                    echo `date` "icsspdchk-co... ICSSPD Daemon
    started successfully. Creating the condition lock file. Please ensure that
    the NT feeder systems are sending audit data." >> $ASERRLOG

                                    touch $CONLOCK

                                    return

                                    else echo `date` "icsspdchk-co... Unable to
    start the ICSSPD Daemon. Please check system immediately." >> $ASERRLOG

                                    exit

                            fi

            fi

    Paul Fiengo
    DISA FSO / CACI
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers


  • Next message: Andrew Luande ALT: "Advice on slice and raid5"