Example diagstart3S Script File


# DIAG 3S
# Do not erase top line. Chkdskt searches for the string DIAG 3S
#
# COMPONENT_NAME: DIAGBOOT - DIAGNOSTIC GRAPHIC SUPPLEMENTAL
# DISKETTE
#
# FUNCTIONS: Diagnostic Diskette Supplemental Script File
#
# ORIGINS: 27
 

configure=0
# See if there is a need to add stanzas to database.
# This is done by searching the /etc/addfile for your stanza file
# name. If not found, add stanzas and call /etc/cfgmgr to
# configure the resources that are needed to be tested.

cd /etc/stanzas
set `echo *`
ADD=`echo $1`
 

# Warning: If your stanza is already in PDiagDev, DO NOT ADD
another one in again. 

for i in `/bin/cat /etc/addfile`
do
        if [ $i = $ADD ]
        then
                configure=1
                break
        fi
done

# Check the PDiagDev for a DType/DSClass equal to your stanza
# before adding  in the new one. If not found, add stanzas and
# call /etc/cfgmgr to configure the resources that are needed to
# be tested.

if [ $configure = 0 ]
then
        # Check the PDiagDev for a DType/DSClass equal to your stanza
        # before adding  in the new one. If not found, add stanzas and
        # call /etc/cfgmgr to configure the resources that are needed to
        # be tested.
        X=`odmget -q"DType=DeviceType and DSClass=SubClass" PDiagDev`
if [ "X$X" != X ]
then
        # save the data and read it in later with the diagcleanup script.
        odmget -q"DType=DeviceType and DSClass=SubClass" PDiagDev > /tmp/mysave
        odmdelete -q"DType=DeviceType and DSClass=SubClass" -o PDiagDev

fi
        for i in *.add
        do
                odmadd $i                         >>$F1 2>&1
                echo $i >> /etc/addfile
                rm $i                             >>$F1 2>&1
        done
        /etc/cfgmgr      -t -d                    >>$F1 2>&1
else
        for i in *.add
        do
                rm $i                             >>$F1 2>&1
        done
fi

echo > /tmp/3S           # flag that indicates diskette read.
exit 0