home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2684 / INSTALL < prev    next >
Text File  |  1991-02-06  |  3KB  |  109 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.  
  15. # Man pages.
  16. MAUTHUSER=/usr/man/man3/authuser.3
  17. MAUTHD=/usr/man/man8/authd.8
  18. MTCPUID=/usr/man/man8/tcpuid.8
  19. MTCPUNAME=/usr/man/man8/tcpuname.8
  20.  
  21. # Name of port 113 in /etc/services.
  22. PORTNAME=auth
  23.  
  24. echo "Each action will be printed before it is run. Press return to proceed."
  25.  
  26. echo "1. Install authd, tcpuid, and tcpuname."
  27. echo "! install -c -g $MEM -m $MODE authd $AUTHD: " | tr -d '\012'
  28. read line
  29. install -c -g "$MEM" -m "$MODE" authd "$AUTHD"
  30.  
  31. echo "! rm -f $TCPUID; ln $AUTHD $TCPUID: " | tr -d '\012'
  32. read line
  33. rm -f "$TCPUID"; ln "$AUTHD" "$TCPUID"
  34.  
  35. echo "! rm -f $TCPUNAME; ln $AUTHD $TCPUNAME: " | tr -d '\012'
  36. read line
  37. rm -f "$TCPUNAME"; ln "$AUTHD" "$TCPUNAME"
  38.  
  39. echo "2. Install the authuser library."
  40. echo "! ar rv $AUTHUSER authuser.o: " | tr -d '\012'
  41. read line
  42. ar rv "$AUTHUSER" authuser.o
  43.  
  44. echo "! ranlib $AUTHUSER: " | tr -d '\012'
  45. read line
  46. ranlib "$AUTHUSER"
  47.  
  48. echo "! chmod 644 $AUTHUSER: " | tr -d '\012'
  49. read line
  50. chmod 644 "$AUTHUSER"
  51.  
  52. echo "3. Make the man pages available."
  53. echo "! install -c -m 0444 authuser.3 $MAUTHUSER: " | tr -d '\012'
  54. read line
  55. install -c -m 0444 authuser.3 "$MAUTHUSER"
  56.  
  57. echo "! install -c -m 0444 authd.8 $MAUTHD: " | tr -d '\012'
  58. read line
  59. install -c -m 0444 authd.8 "$MAUTHD"
  60.  
  61. echo "! install -c -m 0444 tcpuid.8 $MTCPUID: " | tr -d '\012'
  62. read line
  63. install -c -m 0444 tcpuid.8 "$MTCPUID"
  64.  
  65. echo "! install -c -m 0444 tcpuname.8 $MTCPUNAME: " | tr -d '\012'
  66. read line
  67. install -c -m 0444 tcpuname.8 "$MTCPUNAME"
  68.  
  69. echo "4. Make sure an auth port is in /etc/services."
  70. echo "Let me glance at /etc/services for you..."
  71. if grep '^'$PORTNAME'[     ]*113/tcp' /etc/services >/dev/null 2>&1
  72. then echo "Okay, you have it already. Let's continue."
  73. else echo "Nope, it's not there."
  74.      echo "Let me check that you don't have a different auth port..."
  75.      if grep '^'$PORTNAME'[     ][     ]*' /etc/services >/dev/null 2>&1
  76.      then echo "Aaack! $PORTNAME is already used in /etc/services. Exiting."
  77.       exit 1
  78.      fi
  79.      echo "! echo $PORTNAME'    113/tcp' >> /etc/services: " | tr -d '\012'
  80.      read line
  81.      echo "$PORTNAME"'        113/tcp' >> /etc/services
  82. fi
  83.  
  84. echo "5. Enable auth in /etc/inetd.conf."
  85. echo "Let me glance at /etc/inetd.conf for you..."
  86. if grep '^'"$PORTNAME"'[     ]' /etc/inetd.conf >/dev/null 2>&1
  87. then echo "Okay, it's already there. That's it!"
  88.      exit 0
  89. fi
  90. if grep 'telnet.*root' /etc/inetd.conf >/dev/null 2>&1
  91. then echo "It's not there yet. Hmmm, looks like you have a Sun-style inetd."
  92.      echo "! echo $PORTNAME' stream tcp nowait root '$AUTHD' authd' >> /etc/inetd.conf: " | tr -d '\012'
  93.      read line
  94.      echo "$PORTNAME"'    stream    tcp    nowait    root    '"$AUTHD"'    authd' >> /etc/inetd.conf
  95. else echo "It's not there yet."
  96.      echo "! echo $PORTNAME' stream tcp nowait '$AUTHD' authd' >> /etc/inetd.conf: " | tr -d '\012'
  97.      read line
  98.      echo "$PORTNAME"'    stream    tcp    nowait    '"$AUTHD"'    authd' >> /etc/inetd.conf
  99. fi
  100.  
  101. echo "6. Let inetd know about the new service."
  102. echo "On most machines you have to % kill -HUP nn"
  103. echo "where nn is the number of the inetd process."
  104. echo "Here's what ps augx shows about inetd:"
  105. ps augx | sed -n -e 1p -e /inetd/p
  106. echo "I'll leave this step to you. That's it!"
  107.  
  108. exit 0
  109.