home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume18 / diskhog2 / configure < prev    next >
Encoding:
Text File  |  1989-03-26  |  1.5 KB  |  81 lines

  1.  
  2. #
  3. # shell script to install diskhog
  4. #
  5. DQUOTAS="/usr/lib/disk"
  6. BIN="/usr/bin"
  7.  
  8. echo "Hi there, just a few questions about your system ..."
  9. cat << EOF
  10. I need a place to hold all the information about disk usage and allowances.
  11.  
  12. I would suggest using the directory $DQUOTAS.
  13.  
  14. EOF
  15. echo "If you want a different one, enter it here: \c"
  16. read ANS
  17. if [ "$ANS" != "" ]
  18. then
  19.     DQUOTAS=$ANS
  20.     echo "OK, using $DQUOTAS"
  21. fi
  22. if [ -f $DQUOTAS ]
  23. then
  24.     echo "Oh dear, that seems to be a file"
  25.     echo "That won't do at all ..."
  26.     exit 0
  27. else
  28.     if [ -d $DQUOTAS ]
  29.     then
  30.         echo "That directory already exists - I hope it's empty\n"
  31.     else
  32.         echo "Making a new directory"
  33.         mkdir $DQUOTAS $DQUOTAS/hogs
  34.         chmod 755 $DQUOTAS/hogs
  35.         chown root $DQUOTAS/hogs
  36.     fi
  37. fi
  38. cat << EOF
  39. Where do you intend to install the programs?
  40.  
  41. I would suggest $BIN, but you might use another directory.
  42.  
  43. EOF
  44. echo "If you want a different directory, enter it here: \c"
  45. read ANS
  46. if [ "$ANS" != "" ]
  47. then
  48.     BIN=$ANS
  49.     echo "OK - using $BIN"
  50. fi
  51. echo "OK - reconfiguring the system ... \c"
  52. cat << EOF > diskhog.h
  53. #define DQUOTAS "$DQUOTAS"
  54. #define BIN "$BIN"
  55. EOF
  56. ed - dcheck << EOF > /dev/null
  57. /^DQUOTAS=/c
  58. DQUOTAS=$DQUOTAS            # directory containing all the info
  59. .
  60. w
  61. q
  62. EOF
  63. ed - diskhog << EOF > /dev/null
  64. /^DQUOTAS=/c
  65. DQUOTAS=$DQUOTAS            # directory containing all the info
  66. .
  67. w
  68. q
  69. EOF
  70. ed Makefile << EOF > /dev/null
  71. /^BIN=/c
  72. BIN=$BIN                # directory for binaries
  73. .
  74. /^DQUOTAS=/c
  75. DQUOTAS=$DQUOTAS
  76. .
  77. w
  78. q
  79. EOF
  80. echo "OK - your system has been configured"
  81.