Software Distributor Administration Guide HP-UX 11i v1, 11i v2, and 11i v3 (5900-2488, September 2012)

A preremove script is executed for installations into the primary root (“/”) or an alternate root.
The scope of actions of a preremove script should be within the product itself (that is, the files
within the product’s directory).
The de-customization or unconfiguration-configuration tasks which must be performed to disable
the product/fileset for general use must not be done in a preremove script, instead they should
be done in an unconfigure script (described above).
11.5.11 Postremove Scripts
Postremove scripts are executed during the remove phase of a swremove session. The pathname
of the script being executed is:
$ {SW_CONTROL_DIRECTORY}postremove
All postremove scripts for a product are executed immediately after the product’s fileset files
are removed.
A postremove script should perform specific tasks related to the files just removed. The swremove
session will proceed with the remainder of the session regardless of the return value from a
postremove script. Example actions include:
Removing any files still remaining after preremove and the swremove file removal have
completed.
Removal of directories wholly owned by the fileset and which have been emptied by the
file removal.
A postremove script is executed for installations into the primary root (“/”) and an alternate
root. The scope of actions of a postremove script should be within the product itself (that is,
the files within the product’s directory).
The de-customization or unconfiguration-configuration tasks which must be performed to disable
the product/fileset for general use should not be done in the postremove script, instead they
should be done in the unconfigure script (described above).
11.5.12 Request Scripts
Request scripts are interactive scripts that request a response from the user as part of software
installation or configuration. The pathname of the script being executed is:
$ {SW_CONTROL_DIRECTORY}request
Request scripts write information into a response file for later use by the configure script or
other scripts. You can run requests scripts by executing the swask command or using the ask
option with swinstall or swconfig after selection and before the analysis phase.
The POSIX default for request scripts is a shell script. The shell script must be able to:
Ask questions of the user.
Read the user’s answer.
List all current user responses in a redrawn screen.
Ask the user to confirm an answer and continue or to go back.
The request script stores the user response in a response file. The path of the response file is
accessible by the SW_CONTROL_DIRECTORY environment variable.
11.5 Execution of Control Scripts 221