#!/bin/sh
echo
echo
printf "\t\tcheck_patches for AIX V1.0"
echo
echo
printf "\t1 System patches:IY58143 IY59386 IY60930 IY66513\n\t\t\tIY70159 IY63969 IY69911 IY70276 IY70277\n"
printf "\t2 VAC 6 C/C++ patches:U489726\n"
printf "\t3 HACMP5.1 patches:IY42783 IY43602 IY45695 U496124\n"
printf "\t4 JDK patches:IY47055(JDK 1.3.1.11_32bit);IY47536(JDK 1.4.1.2_32bit);\n\t\t\tIY47538(JDK 1.4.1.1_64bit)\n"
echo
echo "Please select:"
printf "\t\t1 check System patches\n\t\t2 check VAC 6 C/C++ patches\n\t\t3 check HACMP patches\n\t\t4 check JDK patches\n\t\t5 exit\n"
echo "Please Input you choice:"
PATCH_SYSTEM="IY58143 IY59386 IY60930 IY66513 IY70159 IY63969 IY69911 IY70276 IY70277"
PATCH_DEVELOPER="U489726"
PATCH_HACMP="IY42783 IY43602 IY45695"
PATCH_JDK="IY47055 IY47536 IY47538"
read SEL
case $SEL in
1)
for i in $PATCH_SYSTEM
do
instfix -ik $i > /tmp/check_fix_${i}.out 2>&1
COM1=`grep no /tmp/check_fix_${i}.out | awk '{print $3}'`
if [ "$COM1" = "no" ]
then
echo "$i NOT ISTALLED!"
else
echo "$i WAS INSTALLED!"
fi
done
;;
2)
lslpp -l -B $PATCH_DEVELOPER > /tmp/check_fix_VAC.out 2>&1
COM1=`grep not /tmp/check_fix_VAC.out | awk '{print $9}'`
if [ "$COM1" = "not" ]
then
echo "U489726 NOT ISTALLED!"
else
echo "U489726 WAS INSTALLED!"
fi
;;
3)
for i in $PATCH_HACMP
do
instfix -ik $i > /tmp/check_fix_${i}.out 2>&1
COM1=`grep no /tmp/check_fix_${i}.out | awk '{print $3}'`
if [ "$COM1" = "no" ]
then
echo "$i NOT ISTALLED!"
else
echo "$i WAS INSTALLED!"
fi
done
lslpp -l -B $PATCH_DEVELOPER > /tmp/check_fix_HACMP.out 2>&1
COM2=`grep not /tmp/check_fix_HACMP.out | awk '{print $9}'`
if [ "$COM2" = "not" ]
then
echo "U496124 NOT ISTALLED!"
else
echo "U496124 WAS INSTALLED!"
fi
;;
4)
for i in $PATCH_JDK
do
instfix -ik $i > /tmp/check_fix_${i}.out 2>&1
COM1=`grep no /tmp/check_fix_${i}.out | awk '{print $3}'`
if [ "$COM1" = "no" ]
then
echo "$i NOT ISTALLED!"
else
echo "$i WAS INSTALLED!"
fi
done
;;
5)
exit 0
;;
esac
echo
echo
printf "\t\tcheck_patches for AIX V1.0"
echo
echo
printf "\t1 System patches:IY58143 IY59386 IY60930 IY66513\n\t\t\tIY70159 IY63969 IY69911 IY70276 IY70277\n"
printf "\t2 VAC 6 C/C++ patches:U489726\n"
printf "\t3 HACMP5.1 patches:IY42783 IY43602 IY45695 U496124\n"
printf "\t4 JDK patches:IY47055(JDK 1.3.1.11_32bit);IY47536(JDK 1.4.1.2_32bit);\n\t\t\tIY47538(JDK 1.4.1.1_64bit)\n"
echo
echo "Please select:"
printf "\t\t1 check System patches\n\t\t2 check VAC 6 C/C++ patches\n\t\t3 check HACMP patches\n\t\t4 check JDK patches\n\t\t5 exit\n"
echo "Please Input you choice:"
PATCH_SYSTEM="IY58143 IY59386 IY60930 IY66513 IY70159 IY63969 IY69911 IY70276 IY70277"
PATCH_DEVELOPER="U489726"
PATCH_HACMP="IY42783 IY43602 IY45695"
PATCH_JDK="IY47055 IY47536 IY47538"
read SEL
case $SEL in
1)
for i in $PATCH_SYSTEM
do
instfix -ik $i > /tmp/check_fix_${i}.out 2>&1
COM1=`grep no /tmp/check_fix_${i}.out | awk '{print $3}'`
if [ "$COM1" = "no" ]
then
echo "$i NOT ISTALLED!"
else
echo "$i WAS INSTALLED!"
fi
done
;;
2)
lslpp -l -B $PATCH_DEVELOPER > /tmp/check_fix_VAC.out 2>&1
COM1=`grep not /tmp/check_fix_VAC.out | awk '{print $9}'`
if [ "$COM1" = "not" ]
then
echo "U489726 NOT ISTALLED!"
else
echo "U489726 WAS INSTALLED!"
fi
;;
3)
for i in $PATCH_HACMP
do
instfix -ik $i > /tmp/check_fix_${i}.out 2>&1
COM1=`grep no /tmp/check_fix_${i}.out | awk '{print $3}'`
if [ "$COM1" = "no" ]
then
echo "$i NOT ISTALLED!"
else
echo "$i WAS INSTALLED!"
fi
done
lslpp -l -B $PATCH_DEVELOPER > /tmp/check_fix_HACMP.out 2>&1
COM2=`grep not /tmp/check_fix_HACMP.out | awk '{print $9}'`
if [ "$COM2" = "not" ]
then
echo "U496124 NOT ISTALLED!"
else
echo "U496124 WAS INSTALLED!"
fi
;;
4)
for i in $PATCH_JDK
do
instfix -ik $i > /tmp/check_fix_${i}.out 2>&1
COM1=`grep no /tmp/check_fix_${i}.out | awk '{print $3}'`
if [ "$COM1" = "no" ]
then
echo "$i NOT ISTALLED!"
else
echo "$i WAS INSTALLED!"
fi
done
;;
5)
exit 0
;;
esac