ibmversioncheck 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #!/bin/ksh
  2. #set -x
  3. ######################################################################
  4. # check to see if the system release is OK and build environments are OK
  5. # on an AIX build box
  6. # Yanling Qi (yanling@austin.ibm.com) (512-838-2846)
  7. ######################################################################
  8. #
  9. Lslpp()
  10. {
  11. /bin/lslpp -lc $1|grep "usr"|grep -v "AVAILABLE"
  12. }
  13. #
  14. # (1) check oslevel
  15. #
  16. OSLEVEL=$(/bin/oslevel |fgrep '3250')
  17. print "\nCheck OS level......"
  18. if [ "XX$OSLEVEL" = "XX" ]; then
  19. echo " System Release Incorrect. /bin/oslevel should be 3250"
  20. echo " system is instead `/bin/oslevel`"
  21. echo ""
  22. else
  23. echo " Check oslevel Passed"
  24. fi
  25. #
  26. # (2) check basic operating system package (/usr/bin /usr/lpp and some
  27. # /usr/lib /usr/bin/ld
  28. #
  29. print "\nCheck basic operating system package......"
  30. Lslpp bos.obj |awk -F: '{
  31. if ($1 ~ "usr")
  32. {
  33. if($2 == "bos.obj 03.02.00.00" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  34. printf(" Check base Operating System Package: Passed\n");
  35. else {
  36. printf("Package should be: bos.obj 03.02.00.00\n")
  37. printf(" yours is: %s\n",$0);
  38. }
  39. }
  40. else # missing this package
  41. printf("Package bos.obj 03.02.00.00 is missing\n")
  42. }'
  43. #
  44. # (3) Check C++ compliler
  45. print "\nCheck C++ compliler......"
  46. Lslpp xlCcmp.obj |awk -F: '{
  47. if ($1 ~ "usr")
  48. if($2 == "xlCcmp.obj 01.01.02.29" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  49. printf(" Check AIX XL C++ Compiler/6000 Package: Passed\n");
  50. else{
  51. printf(" Package should be xlCcmp.obj 01.01.02.29\n")
  52. printf(" yours is: %s\n",$0);
  53. }
  54. else # missing this package
  55. printf("Package xlCcmp.obj 01.01.02.29 is missing\n");
  56. }'
  57. #
  58. # (4) check C++ lib /usr/lpp/xlC/lib/libC.a
  59. # /usr/lpp/xlC/lib/profiled/libC.a
  60. #
  61. print "\nCheck C++ lib......"
  62. Lslpp xlCrte.obj|awk -F: '{
  63. if ($1 ~ "usr")
  64. if($2 == "xlCrte.obj 01.01.02.29" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  65. printf(" Check AIX XL C++ Compiler/6000 Runtime Package: Passed\n");
  66. else{
  67. printf(" Package should be xlCrte.obj 01.01.02.29\n")
  68. printf(" yours is: %s\n",$0);
  69. }
  70. else # missing this package
  71. printf("Package xlCrte.obj 01.01.02.29 is missing\n");
  72. }'
  73. #
  74. # (5) check c compliler
  75. #
  76. print "\nCheck xl c compiler......"
  77. Lslpp xlccmp.obj |awk -F: '{
  78. if ($1 ~ "usr")
  79. if($2 == "xlccmp.obj 01.03.00.12" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  80. printf(" Check AIX XL C Compiler Package: Passed\n");
  81. else{
  82. printf(" Package should be xlccmp.obj 01.03.00.12\n")
  83. printf(" yours is: %s\n",$0);
  84. }
  85. else # missing this package
  86. printf("Package xlccmp.obj 01.03.00.12 is missing\n");
  87. }'
  88. #
  89. # (6) check Base Application Development Toolkit
  90. # cpp lex yacc
  91. #
  92. print "\nCheck Base Application Development Toolkit......"
  93. Lslpp bosadt.bosadt.obj |awk -F: '{
  94. if ($1 ~ "usr")
  95. if($2 == "bosadt.bosadt.obj 03.02.00.00" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  96. printf(" Check Base Application Development Toolkit Package: Passed\n");
  97. else{
  98. printf(" Package should be bosadt.bosadt.obj 03.02.00.00\n")
  99. printf(" yours is: %s\n",$0);
  100. }
  101. else # missing this package
  102. printf("Package bosadt.bosadt.obj 03.02.00.00 is missing\n");
  103. }'
  104. #
  105. # (7) check Base Development Libraries & Include files
  106. # cpp lex yacc
  107. #
  108. print "\nCheck Base Development Libraries & Include files......"
  109. Lslpp bosadt.lib.obj |awk -F: '{
  110. if ($1 ~ "usr")
  111. if($2 == "bosadt.lib.obj 03.02.00.00" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  112. printf(" Check Base Development Libraries & Include files Package: Passed\n");
  113. else{
  114. printf(" Package should be bosadt.lib.obj 03.02.00.00\n")
  115. printf(" yours is: %s\n",$0);
  116. }
  117. else # missing this package
  118. printf("Package bosadt.lib.obj 03.02.00.00 is missing\n");
  119. }'
  120. #
  121. # (8) check X Development Libraries and Include Files
  122. #
  123. #
  124. print "\nCheck X Development Libraries and Include Files......"
  125. Lslpp X11dev.obj |awk -F: '{
  126. if ($1 ~ "usr")
  127. if($2 == "X11dev.obj 01.02.03.00" && ($3 == "COMMITTED" || $3 == "APPLIED"))
  128. printf(" Check X Development Libraries and Include Files Package: Passed\n");
  129. else{
  130. printf(" Package should be X11dev.obj 01.02.03.00\n")
  131. printf(" yours is: %s\n",$0);
  132. }
  133. else # missing this package
  134. printf("Package X11dev.obj 01.02.03.00 is missing\n");
  135. }'