Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Ignite-UX Administration Guide: HP Computers with HP-UX 10.x, 11.0 or 11i > Chapter 8 Customizing Your Installation

Using Post-installation Scripts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Any number of tasks may be performed on the target system after the OS is installed by providing a script to be run on the target system. This section touches on some common examples, but scripts can easily be written to mount additional disk drives, add additional software, modify configurations based on system use, etc.

There are a number of points in the install process in which you can force scripts or commands to be run. Check the "Command and Script Execution Hooks" section on the instl_adm(4) manpage for specifics. One point to note is that post_config_script will run after all software has been loaded and the system has been booted with its final kernel, but before any of the normal /etc/rc startup scripts have been run.

Adding a Post-install Script

Example task

  1. Create a script to perform the desired task. When Ignite-UX runs this script as a post-configuration, it will be run on the target system.

  2. Add the script to your configuration file. Ignite-UX post-configuration scripts are defined using the post_config_script variable. For example, you can place this line into your core_700_archive_cfg config file:

    post_config_script += \
    "/var/opt/ignite/scripts/install_default_printer"

    The line above will define the install_default_printer script to be run as a post-installation process on the target system. The line should stand alone, placed outside of any clause (such as a sw_sel clause). By default, the script will always be run on the targets. You can change the behavior by navigating to Install Client -> New install -> Advanced tab.

  3. If you want to make a script available under all configurations, add it to the /var/opt/ignite/INDEX file. Add the following to the end of this file:

    scripts {"/var/opt/ignite/scripts/install_default_printer"}

    It will then show up in the Advanced tab for all configurations.

NOTE: Ignite-UX accesses scripts via tftp. Make sure the directory the script resides in is available to tftp by examining and/or changing the /etc/inetd.conf file.

Managing Network Printers

Example task

One task an administrator generally needs to perform after a new OS installation is setting up printers. To automate this process, write a script which performs the HP-UX commands for adding a printer. Here is a script for adding a remote printer named "printbob", and turning on the lp scheduler. The script turns SAM logging on for "commands-only", performs the tasks desired, and extracts those commands from the SAM log file.

#!/sbin/sh
# Post process IUX script to add a local default printer
# Performing task "Add Remote Printer": Adding "printbob"
#
/usr/sbin/lpadmin -pprintbob -ormhpfcmgw.fc.hp.com -orptsslj \
-mrmodel -v/dev/null -orc -ocmrcmodel -osmrsmodel
/usr/sbin/lpadmin -dprintbob
/usr/sbin/accept printbob
/usr/bin/enable printbob
# Turn on lp scheduler
#
lpsched -v
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.