home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / base / root.15 / usr / lib / hpnp / cfg / option1 / option1~
Text File  |  1998-08-19  |  3KB  |  138 lines

  1. #!/bin/ksh
  2. #ident    "@(#)option1    1.2"
  3. #        copyright    "%c%"
  4. #
  5. # (c)Copyright Hewlett-Packard Company 1991.  All Rights Reserved.
  6. # (c)Copyright 1983 Regents of the University of California
  7. # (c)Copyright 1988, 1989 by Carnegie Mellon University
  8. #                          RESTRICTED RIGHTS LEGEND
  9. # Use, duplication, or disclosure by the U.S. Government is subject to
  10. # restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
  11. # Technical Data and Computer Software clause in DFARS 252.227-7013.
  12. #
  13. #                          Hewlett-Packard Company
  14. #                          3000 Hanover Street
  15. #                          Palo Alto, CA 94304 U.S.A.
  16. #
  17.  
  18. if [ -z "${HPNPDIR}" ]
  19. then
  20.     HPNPDIR="/usr/lib/hpnp"
  21. fi
  22.  
  23. if [ -z "${SERVICES}" ]
  24. then
  25.     SERVICES="/etc/services"
  26. fi
  27.  
  28. if [ -z "${INETDCONF}" ]
  29. then
  30.     INETDCONF="/etc/inetd.conf"
  31. fi
  32.  
  33. typeset -i ALLFINE=1 BOOTPD_FLAG=0 TFTP_FLAG=0
  34. echo ""
  35.  
  36. if [ ! -f "${HPNPDIR}/install.files" ]
  37. then
  38.     echo "Cannot find ${HPNPDIR}/install.files"
  39.     ALLFINE=0
  40. else
  41.     for NAME in `cat -- "${HPNPDIR}/install.files"`
  42.     do
  43.         BNAM=`basename $NAME`
  44.         if [ ! -f "$NAME" ]
  45.         then
  46.             echo "$NAME is missing"
  47.             ALLFINE=0
  48.         else
  49.             if [ "${BNAM}" = "bootpd" ]
  50.             then
  51.                 # If file installed was bootpd need to chk
  52.                 # if correct entries are made in services
  53.                 # and inetd.conf
  54.                 BOOTPD_FLAG=1
  55.             fi
  56.             if [ "${BNAM}" = "tftp" -o "${BNAM}" = "tftpd" ]
  57.             then
  58.                 # If file installed was tftp or tftpd need
  59.                 # to chk if correct entries are made in
  60.                 # services and inetd.conf and passwd
  61.                 TFTP_FLAG=1
  62.             fi
  63.         fi
  64.     done
  65. fi
  66.  
  67. ####################################
  68. #    BOOTPD_FLAG will be 1 only if bootpd was added
  69. ####################################
  70. if [ $BOOTPD_FLAG -eq 1 ]
  71. then
  72.   ETC_SERVICES="bootpc bootps"
  73.   for i in $ETC_SERVICES
  74.   do
  75.     if egrep "^$i" "$SERVICES" > /dev/null 2>&1
  76.     then
  77.       :
  78.     fi
  79.   done
  80.  
  81.   if egrep "^bootps" "$INETDCONF" > /dev/null 2>&1
  82.   then
  83.     :
  84.   else
  85.       echo "bootps service not found in /etc/inetd.conf."
  86.       ALLFINE=0
  87.   fi
  88. fi
  89.   
  90. ####################################
  91. #
  92. #    TFTP_FLAG will be 1 only if tftp or tftpd was added to the
  93. #    Sun or HP system as part of hpnpinstall.  There needs to
  94. #    be a tftp entry in /etc/services, there needs to be a 
  95. #    tftp entry in /etc/inetd.conf, and there needs to be a
  96. #    tftp entry in /etc/passwd.
  97. #    Note:  tftp and tftpd will normally not be added to Sun since sun
  98. #    has these files in default condition.
  99. #
  100. ####################################
  101. if [ $TFTP_FLAG -eq 1 ]
  102. then
  103.   if egrep "^tftp" "$INETDCONF" > /dev/null 2>&1
  104.   then
  105.     :
  106.   else
  107.     echo "tftp service not found in /etc/inetd.conf."
  108.     ALLFINE=0
  109.   fi
  110.   if egrep "^tftp" "$SERVICES" > /dev/null 2>&1
  111.   then
  112.     :
  113.   else
  114.     echo "tftp service not found in /etc/services."
  115.     ALLFINE=0
  116.   fi
  117.   if egrep "^tftp" /etc/passwd > /dev/null 2>&1
  118.   then
  119.     :
  120.   else
  121.     echo "tftp entry not found in /etc/passwd"
  122.     ALLFINE=0
  123.   fi
  124. fi
  125.  
  126.  
  127. if [ $ALLFINE -eq 1 ]
  128. then
  129.   echo "Software verification passed."
  130. else
  131.   echo "\nSoftware verification failed."
  132. fi
  133.  
  134. echo "\nPress the return key to continue ... $NL"
  135. read -r RESP
  136. echo ""
  137.