home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2725 / INSTALL < prev    next >
Text File  |  1991-02-09  |  4KB  |  114 lines

  1. #!/bin/sh
  2.  
  3. # Change kmem to staff and mode to 0755 if you don't have a kmem group,
  4. # or if you don't want normal users to be able to use these utilities.
  5. MEM=kmem
  6. MODE=02755
  7.  
  8. # These must all be in the same filesystem.
  9. AUTHD=/etc/authd
  10. TCPUID=/etc/tcpuid
  11. TCPUNAME=/etc/tcpuname
  12.  
  13. AUTHUSER=/usr/lib/libauthuser.a
  14. AUTHUSERH=/usr/include/authuser.h
  15.  
  16. # Man pages.
  17. MAUTHUSER=/usr/man/man3/authuser.3
  18. MAUTHD=/usr/man/man8/authd.8
  19. MTCPUID=/usr/man/man8/tcpuid.8
  20. MTCPUNAME=/usr/man/man8/tcpuname.8
  21.  
  22. # Name of port 113 in /etc/services.
  23. PORTNAME=auth
  24.  
  25. echo "Each action will be printed before it is run. Press return to proceed."
  26.  
  27. echo "1. Install authd, tcpuid, and tcpuname."
  28. echo "! install -c -g $MEM -m $MODE authd $AUTHD: " | tr -d '\012'
  29. read line
  30. install -c -g "$MEM" -m "$MODE" authd "$AUTHD"
  31.  
  32. echo "! rm -f $TCPUID; ln $AUTHD $TCPUID: " | tr -d '\012'
  33. read line
  34. rm -f "$TCPUID"; ln "$AUTHD" "$TCPUID"
  35.  
  36. echo "! rm -f $TCPUNAME; ln $AUTHD $TCPUNAME: " | tr -d '\012'
  37. read line
  38. rm -f "$TCPUNAME"; ln "$AUTHD" "$TCPUNAME"
  39.  
  40. echo "2. Install the authuser library."
  41. echo "! install -c -m 0444 authuser.h $AUTHUSERH: " | tr -d '\012'
  42. read line
  43. install -c -m 0444 authuser.h "$AUTHUSERH"
  44.  
  45. echo "! ar rv $AUTHUSER authuser.o: " | tr -d '\012'
  46. read line
  47. ar rv "$AUTHUSER" authuser.o
  48.  
  49. echo "! ranlib $AUTHUSER: " | tr -d '\012'
  50. read line
  51. ranlib "$AUTHUSER"
  52.  
  53. echo "! chmod 644 $AUTHUSER: " | tr -d '\012'
  54. read line
  55. chmod 644 "$AUTHUSER"
  56.  
  57. echo "3. Make the man pages available."
  58. echo "! install -c -m 0444 authuser.3 $MAUTHUSER: " | tr -d '\012'
  59. read line
  60. install -c -m 0444 authuser.3 "$MAUTHUSER"
  61.  
  62. echo "! install -c -m 0444 authd.8 $MAUTHD: " | tr -d '\012'
  63. read line
  64. install -c -m 0444 authd.8 "$MAUTHD"
  65.  
  66. echo "! install -c -m 0444 tcpuid.8 $MTCPUID: " | tr -d '\012'
  67. read line
  68. install -c -m 0444 tcpuid.8 "$MTCPUID"
  69.  
  70. echo "! install -c -m 0444 tcpuname.8 $MTCPUNAME: " | tr -d '\012'
  71. read line
  72. install -c -m 0444 tcpuname.8 "$MTCPUNAME"
  73.  
  74. echo "4. Make sure an auth port is in /etc/services."
  75. echo "Let me glance at /etc/services for you..."
  76. if grep '^'$PORTNAME'[     ]*113/tcp' /etc/services >/dev/null 2>&1
  77. then echo "Okay, you have it already. Let's continue."
  78. else echo "Nope, it's not there."
  79.      echo "Let me check that you don't have a different auth port..."
  80.      if grep '^'$PORTNAME'[     ][     ]*' /etc/services >/dev/null 2>&1
  81.      then echo "Aaack! $PORTNAME is already used in /etc/services. Exiting."
  82.       exit 1
  83.      fi
  84.      echo "! echo $PORTNAME'    113/tcp' >> /etc/services: " | tr -d '\012'
  85.      read line
  86.      echo "$PORTNAME"'        113/tcp' >> /etc/services
  87. fi
  88.  
  89. echo "5. Enable auth in /etc/inetd.conf."
  90. echo "Let me glance at /etc/inetd.conf for you..."
  91. if grep '^'"$PORTNAME"'[     ]' /etc/inetd.conf >/dev/null 2>&1
  92. then echo "Okay, it's already there. That's it!"
  93.      exit 0
  94. fi
  95. if grep 'telnet.*root' /etc/inetd.conf >/dev/null 2>&1
  96. then echo "It's not there yet. Hmmm, looks like you have a Sun-style inetd."
  97.      echo "! echo $PORTNAME' stream tcp nowait root '$AUTHD' authd' >> /etc/inetd.conf: " | tr -d '\012'
  98.      read line
  99.      echo "$PORTNAME"'    stream    tcp    nowait    root    '"$AUTHD"'    authd' >> /etc/inetd.conf
  100. else echo "It's not there yet."
  101.      echo "! echo $PORTNAME' stream tcp nowait '$AUTHD' authd' >> /etc/inetd.conf: " | tr -d '\012'
  102.      read line
  103.      echo "$PORTNAME"'    stream    tcp    nowait    '"$AUTHD"'    authd' >> /etc/inetd.conf
  104. fi
  105.  
  106. echo "6. Let inetd know about the new service."
  107. echo "On most machines you have to % kill -HUP nn"
  108. echo "where nn is the number of the inetd process."
  109. echo "Here's what ps acugx shows about inetd:"
  110. ps acugx | sed -n -e 1p -e /inetd/p
  111. echo "I'll leave this step to you. That's it!"
  112.  
  113. exit 0
  114.