2 ################################################################################
4 # File: reinstall_patch_bundle
6 # Description: A script to reinstall the Patches bundle by removing it and
8 # Author: Andrew DeFaria, California Language Labs
9 # Created: Thu May 1 23:06:48 PDT 1997
11 # Language: Korn Shell
13 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
15 ################################################################################
17 notify=defaria@cup.hp.com
19 osver=`uname -r | cut -f2- -d.`
20 major_osver=`echo $osver | cut -f1 -d.`
21 depot="wampus:/Depots/$osver"
23 if [ "$major_osver" = "10" ]; then
24 if [ `id -u` -ne 0 ]; then
25 print -u2 "$me: Error: You must be root to use this command"
28 message="Reinstalling Patches bundle from $depot to $machine via $0"
29 mailx -s "$message" $notify <<!EOF
32 # First remove the old Patches bundle. Note that we do not enforce_scripts
33 # nor auto_kernel_build because we are going to be totally replacing the
35 additional_patches=$(/usr/sbin/swlist | grep PH | tr " " " " | cut -c3- | cut -f1 -d' ')
37 -x enforce_scripts=false \
38 -x auto_kernel_build=false \
39 Patches $additional_patches > /tmp/$me.$$ 2>&1
42 message="Removal of Patches bundle failed!"
43 mailx -s "$message" $notify < /tmp/$me.$$
47 # Next install the new Patches bundle.
50 -s $depot Patches > /tmp/$me.$$ 2>&1
53 message="Installation of Patches bundle failed!"
54 mailx -s "$message" $notify < /tmp/$me.$$
58 message="Sorry but $0 only works on 10.x machines. This machine is