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.
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