You can find additional examples of probe and comparison functions in the following directories:
/usr/sbin/install.d/chkprobe on a system that has the Solaris software installed
/Solaris_9/Tools/Boot/usr/sbin/install.d/chkprobe on the Solaris DVD or on the Solaris Software 1 of 2 CD
The following custom_probes file contains a probe and comparison function that tests for the presence of a TCX graphics card.
#!/bin/sh # # custom_probe script to test for the presence of a TCX graphics card. # # # PROBE FUNCTIONS # probe_tcx() { SI_TCX=`modinfo | grep tcx | nawk '{print $6}'` export SI_TCX } # # COMPARISON FUNCTIONS # cmp_tcx() { probe_tcx if [ "X${SI_TCX}" = "X${1}" ]; then return 0 else return 1 fi } |
The following example rules file shows the use of the probe keyword that is defined in the preceding example, tcx. If a TCX graphics card is installed and found in a system, profile_tcx is run. Otherwise, profile is run.
Always place probe keywords at or near the beginning of the rules file to ensure that the keywords are read and run before other rule keywords that might rely on the probe keywords.
probe tcx tcx tcx - profile_tcx - any any - profile - |