Editing The Package Test Script For Unix Systems - IBM Prerequisite Scanner User Manual

Table of Contents

Advertisement

3. Add the code to obtain the value for the prerequisite property by using
4. Ensure the check returns standard output:
5. Run the custom collector to ensure that there are no runtime errors and debug
6. Edit the ips_root/UNIX_Linux/packageTest.sh script to call and run the custom
7. Create a custom evaluator only if the custom collector returns values other than

Editing the package test script for UNIX systems

You can update the packageTest.sh script file to call custom collectors on UNIX
systems.
Before you begin
Ensure that you know the names of the collectors associated with predefined
prerequisite properties, as outlined in Appendix D, "Predefined collectors for UNIX
systems," on page 107. If the prerequisite property is further categorized by
application, utility, or service subtype, pass the differentiator for the suffix_identifier
subtype, that is, differentiator_suffix_identifier to its collector.
For example, os.package is the common collector to check for the existence of
packages. To check for the existence of openssh, pass the name of the package
when invoking the os.package collector in the packageTest.sh script file, as
follows:
./os.package openssh
Where openssh is the name of the package, that is, the suffix_identifier subtype and
differentiator_suffix_identifier differentiator.
Procedure
1. Using an editor, open the ips_root/UNIX_Linux/packageTest.sh script.
2. Add the code to read the custom prerequisite property from the configuration
commands and options specific to that platform to access elements of the host
environment. For example, the custom env.path.jar prerequisite property
needs to check whether the JRE is set in the PATH variable. The following code
runs the env command, searches the output for PATH variable, and then searches
its value for the JRE path.
envJRE=`env | grep "PATH" | grep -w "/opt/IBM/Java60/jre/bin"`
echo "True"|"False" 'If the scan checks for the existence of the prerequisite
property
echo $res 'If the scan checks returns the value, for example, product version,
'of the prerequisite property
echo "Unavailable" 'If the scan returns no value for the prerequisite property
echo "Available" 'If the scan returns a valid check for the prerequisite property
In the example, based on the value of the $envJRE variable, the check either
returns True or False:
if [ $envJRE ]; then
echo "True"
else
echo "False"
fi
as necessary.
collector.
boolean values.
file and parse its value.
Chapter 3. Extending Prerequisite Scanner
51

Advertisement

Table of Contents
loading

Table of Contents