home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / datafile / misc / inst_12_df / .instutils < prev    next >
Encoding:
Text File  |  1996-07-07  |  4.6 KB  |  158 lines

  1. # $NetBSD: dot.instutils,v 1.1 1996/05/16 19:58:58 mark Exp $
  2. #
  3. # Copyright (c) 1994 Christopher G. Demetriou
  4. # All rights reserved.
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # 1. Redistributions of source code must retain the above copyright
  9. #    notice, this list of conditions and the following disclaimer.
  10. # 2. Redistributions in binary form must reproduce the above copyright
  11. #    notice, this list of conditions and the following disclaimer in the
  12. #    documentation and/or other materials provided with the distribution.
  13. # 3. All advertising materials mentioning features or use of this software
  14. #    must display the following acknowledgement:
  15. #    This product includes software developed by Christopher G. Demetriou.
  16. # 4. The name of the author may not be used to endorse or promote products
  17. #    derived from this software without specific prior written permission
  18. #
  19. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  20. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  21. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  23. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  24. # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  28. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. #
  30.  
  31. # Installation configuration utilites (functions), to get NetBSD configured
  32. # reasonably once it is installed on the hard disk.  These are meant to be
  33. # invoked from the shell prompt, by people installing NetBSD.
  34.  
  35. Configure()
  36. {
  37.     DEV=/dev
  38.     ETC=/etc
  39.     if [ ! -f /etc/fstab ]; then
  40.         DEV=/mnt/dev
  41.         ETC=/mnt/etc
  42.     fi
  43.  
  44.     echo    "You will now be prompted for information about this"
  45.     echo    "machine.  If you hit return, the default answer (in"
  46.     echo    "brackets) will be used."
  47.  
  48.     echo    ""
  49.     echo -n    "What is this machine's hostname? [unknown.host.domain] "
  50.     read hname
  51.     if [ "$hname" = "" ]; then
  52.         hname=unknown.host.domain
  53.     fi
  54.     echo $hname > ${ETC}/myname
  55.     proto_domain=`echo $hname | sed -e 's/[^.]*\.//'`
  56.  
  57.     echo    ""
  58.     echo    "What domain is this machine in (this is NOT its YP"
  59.     echo -n    "domain name)? [$proto_domain] "
  60.     read dname
  61.     if [ "$dname" = "" ]; then
  62.         dname=$proto_domain
  63.     fi
  64.  
  65.     echo    ""
  66.     if [ -e $ETC/sendmail.cf ]; then
  67.         echo    "WARNING: A default sendmail.cf exists, and probably"
  68.         echo    "needs to be tuned and/or replaced, to work properly at"
  69.         echo    "your site!"
  70.     else
  71.         echo    "WARNING: No default sendmail.cf installed.  Did you"
  72.         echo    "forget to install the 'etc' distribution?"
  73.     fi
  74.  
  75.     echo    "127.0.0.1    localhost localhost.$dname" > ${ETC}/hosts
  76.  
  77.     echo    ""
  78.     echo -n    "Does this machine have an ethernet interface? [y] "
  79.         read resp
  80.         case "$resp" in
  81.     n*)
  82.         ;;
  83.     *)
  84.         intf=
  85.         while [ "$intf" = "" ]; do
  86.             echo -n "What is the primary interface name "
  87.             echo -n "(e.g. ed0, ep0, etc)? "
  88.             read intf
  89.         done
  90.         echo -n "What is the hostname for this interface? [$hname] "
  91.         read ifname
  92.         if [ "$ifname" = "" ]; then
  93.             ifname=$hname
  94.         fi
  95.         ifaddr=
  96.         while [ "$ifaddr" = "" ]; do
  97.             echo -n "What is the IP address associated with "
  98.             echo -n "interface ${intf}? "
  99.             read ifaddr
  100.         done
  101.         echo "$ifaddr    $ifname `echo $ifname | sed -e s/\.$dname//`" \
  102.             >> ${ETC}/hosts
  103.  
  104.         echo -n "Does this interface have a special netmask? [n] "
  105.         read resp
  106.         case "$resp" in
  107.             y*)
  108.                 echo -n "What is the netmask? [0xffffff00] "
  109.                 read ifnetmask
  110.                 if [ "$ifnetmask" = "" ]; then
  111.                     ifnetmask=0xffffff00
  112.                 fi
  113.                 ;;
  114.             *)
  115.                 ifnetmask=
  116.                 ;;
  117.         esac
  118.  
  119.         echo -n "Does this interface need additional flags? [n] "
  120.         read resp
  121.         case "$resp" in
  122.             y*)
  123.                 echo -n "What flags? [link0] "
  124.                 read ifflags
  125.                 if [ "$ifflags" = "" ]; then
  126.                     ifflags=link0
  127.                 fi
  128.                 ;;
  129.             *)
  130.                 ifflags=
  131.                 ;;
  132.         esac
  133.         echo "inet $ifname $ifnetmask $ifflags" > ${ETC}/hostname.$intf
  134.  
  135.         echo    ""
  136.         echo -n    "WARNING: if you have any more ethernet interfaces, "
  137.         echo    "you will have to configure"
  138.         echo -n "them by hand.  Read the comments in /etc/netstart to "
  139.         echo    "learn how to do this."
  140.         ;;
  141.     esac
  142.     
  143.     echo    ""
  144.     echo -n    "Making device nodes (may take a while)..."
  145.     cd ${DEV}
  146.     sh MAKEDEV all
  147.     echo    " done."
  148.  
  149.     sync
  150.  
  151.     echo    ""
  152.     echo    "If you haven't already installed a kernel on the hard drive"
  153.     echo    "using your kernel-copy floppy, do so now.  Kernel"
  154.     echo     "installation instructions can be found in the"
  155.     echo     "installation notes."    
  156. }
  157.