Software Distributor Administration Guide HP-UX 11i v1, 11i v2, and 11i v3 (5900-2561, March 2013)
11 Using Control Scripts
This chapter discusses how to use control scripts.
Table 49 Chapter Topics
Topics:
“Types of Control Scripts ” (page 208)
“Using Environment Variables ” (page 213)
“Execution of Control Scripts ” (page 216)
“Execution of Other Commands by Control Scripts ” (page 222)
“Control Script Input and Output” (page 222)
“File Management by Control Scripts ” (page 224)
“Testing Control Scripts ” (page 224)
“Requesting User Responses (swask)” (page 227)
11.1 Introduction to Control Scripts
SD-UX supports execution of both product and fileset control scripts. These shell scripts allow you
to perform additional, customized checks and operations as part your regular software management
tasks. The swinstall, swconfig, swverify, swask, and swremove commands can execute
one or more of these scripts. Control scripts are usually supplied by software vendors, but you can
write your own. All control scripts are optional.
Product level control scripts are run when any fileset within that product is selected for installation,
configuration, verification, or removal so the activities in product control scripts must pertain to all
filesets in that product, but not to any fileset in particular. Actions you want to apply to every fileset
in a product should be in the appropriate product level control script.
Fileset scripts must pertain only to the installation, configuration, or removal of that fileset, and not
to any other fileset or to a parent product.
Control scripts can perform a wide variety of customization and configuration tasks, such as (but
not limited to):
• Verifying if someone is actively using the product and, if so, preventing reinstallation, update
or removal.
• Ensuring the local host system is compatible with the software (scripts can check beyond the
compatibility enforced by the product’s uname attributes).
• Removing obsolete files or previously installed versions of the product.
• Creating links to, or additional copies of, files after they have been installed.
• Copying configurable files into place on first-time installation.
• Conditionally copying configurable files into place on later updates.
• Modifying existing configuration files for new features.
• Rebuilding custom versions of configuration files.
• Creating device files or custom programs.
• Killing and/or starting daemons.
11.1 Introduction to Control Scripts 207