home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / ROOTDSKS.12 / UMSDOS12 / usr / lib / setup / INSNFS < prev    next >
Encoding:
Text File  |  1994-11-02  |  6.1 KB  |  220 lines

  1. #!/bin/sh
  2. while [ 0 ]; do
  3. rm -f /tmp/SeTDS /tmp/SeTmount
  4.  
  5.  cat << EOF > /tmp/tmpmsg
  6.  
  7. WARNING! Installing via NFS can be a real time-saver if you're
  8. good with TCP/IP, but is a tricky installation choice for the
  9. beginner. Some of the things you may have to do to get this
  10. option to work include:
  11.  
  12. -- Setting up an /etc/networks file on the bootdisk
  13. -- Mandatory: getting the source directory exported from 
  14.    your NFS server
  15. -- Starting up 'portmap'
  16.  
  17. Are you sure you want to try to install via NFS?
  18. EOF
  19.  dialog --title "INSTALLATION THROUGH NFS" --yesno "`cat /tmp/tmpmsg`" 17 68
  20.  if [ $? = 1 -o $? = 255 ]; then
  21.   rm -f /tmp/tmpmsg
  22.   exit
  23.  fi
  24.  rm -f /tmp/tmpmsg
  25.  T_PX="`cat /tmp/SeTT_PX`"
  26.  UPNRUN=1
  27.  if [ "$T_PX" = "/" ]; then
  28.   cat << EOF > /tmp/tmpmsg
  29.  
  30. You're running off the hard drive filesystem. Is this machine
  31. currently running on the network you plan to install from? If
  32. so, we won't try to reconfigure your ethernet card.
  33.  
  34. Are you up-and-running on the network?
  35. EOF
  36.   dialog --title "NFS INSTALLATION" --yesno "`cat /tmp/tmpmsg`" 11 68
  37.   UPNRUN=$?
  38.  fi
  39.  if [ $UPNRUN = 1 ]; then
  40.   cat << EOF > /tmp/tmpmsg
  41.  
  42. You will need to enter the IP address you wish to
  43. assign to this machine. Example: 111.112.113.114
  44.  
  45. What is your IP address?
  46. EOF
  47.   dialog --title "ASSIGN IP ADDRESS" --inputbox "`cat /tmp/tmpmsg`" 13 65 2> /tmp/local
  48.   if [ $? = 1 -o $? = 255 ]; then
  49.    rm -f /tmp/tmpmsg /tmp/local
  50.    exit
  51.   fi
  52.   LOCAL_IPADDR="`cat /tmp/local`"
  53.   rm -f /tmp/local
  54.   cat << EOF > /tmp/tmpmsg
  55.  
  56. Now we need to know your netmask.
  57. Typically this will be 255.255.255.0
  58. but this can be different depending on
  59. your local setup.
  60.  
  61. What is your netmask?
  62. EOF
  63.   dialog --title "ASSIGN NETMASK" --inputbox "`cat /tmp/tmpmsg`" 15 65 2> /tmp/mask
  64.   if [ $? = 1 -o $? = 255 ]; then
  65.    rm -f /tmp/tmpmsg /tmp/mask
  66.    exit
  67.   fi
  68.   LOCAL_NETMASK="`cat /tmp/mask`"
  69.   rm /tmp/mask
  70. #  cat << EOF > /tmp/tmpmsg
  71. #
  72. #Typically your broadcast address will be the same as
  73. #your IP address with 255 replacing the final value.
  74. #Example: 111.112.113.255
  75. #
  76. #What is your broadcast address?
  77. #EOF
  78. #  dialog --title "ASSIGN BROADCAST ADDRESS" --inputbox "`cat /tmp/tmpmsg`" 14 65 2> /tmp/broadc
  79. #  if [ $? = 1 -o $? = 255 ]; then
  80. #   rm -f /tmp/tmpmsg /tmp/broadc
  81. #   exit
  82. #  fi
  83. #  LOCAL_BROADCAST="`cat /tmp/broadc`"
  84. #  rm /tmp/broadc
  85. #  cat << EOF > /tmp/tmpmsg
  86. #
  87. #Now we need your network address.
  88. #
  89. #Your network address will usually be the same as your IP
  90. #address, with the last value replaced by 0.
  91. #For example: 111.112.113.0
  92. #
  93. #What is your network address? 
  94. #EOF
  95. #  dialog --title "ASSIGN NETWORK ADDRESS" --inputbox "`cat /tmp/tmpmsg`" 16 65 2> /tmp/netw
  96. #  if [ $? = 1 -o $? = 255 ]; then
  97. #   rm -f /tmp/tmpmsg /tmp/netw
  98. #   exit
  99. #  fi
  100. #  LOCAL_NETWORK="`cat /tmp/netw`"
  101. #  rm /tmp/netw
  102. LOCAL_BROADCAST=`ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 1 -d ' '`
  103. LOCAL_NETWORK=`ipmask $LOCAL_NETMASK $LOCAL_IPADDR | cut -f 2 -d ' '`
  104.   dialog --yesno "Do you have a gateway?" 6 30
  105.   HAVE_GATEWAY=$?
  106.   if [ "$HAVE_GATEWAY" = "0" ]; then
  107.    dialog --title "ASSIGN GATEWAY ADDRESS" --inputbox "\nWhat is your gateway address?" 10 65 2> /tmp/gw
  108.    if [ $? = 1 -o $? = 255 ]; then
  109.     rm -f /tmp/tmpmsg /tmp/gw
  110.     exit
  111.    fi
  112.    LOCAL_GATEWAY="`cat /tmp/gw`"
  113.    rm -f /tmp/gw
  114.   fi
  115.  fi # ! UPNRUN
  116.  
  117.  cat << EOF > /tmp/tmpmsg
  118.  
  119. Good! We're all set on the local end, but now we need to know
  120. where to find the software packages to install. First, we need
  121. the IP address of the machine where the Slackware sources are
  122. stored.
  123.  
  124. EOF
  125.  if [ "$UPNRUN" = "0" ]; then
  126.   cat << EOF >> /tmp/tmpmsg
  127. Since you're already running on the network, you should be able
  128. to use the hostname instead of an IP address if you wish.
  129.  
  130. EOF
  131.  fi
  132.  echo "What is the IP address of your NFS server? " >> /tmp/tmpmsg
  133.  dialog --title "ENTER IP ADDRESS OF NFS SERVER" --inputbox \
  134.  "`cat /tmp/tmpmsg`" 17 70 2> /tmp/remote
  135.  if [ $? = 1 -o $? = 255 ]; then
  136.   rm -f /tmp/tmpmsg /tmp/remote
  137.   exit
  138.  fi
  139.  REMOTE_IPADDR="`cat /tmp/remote`"
  140.  rm /tmp/remote
  141.  if [ ! "$UPNRUN" = "0" ]; then
  142. #  cat << EOF > /tmp/tmpmsg 
  143. #
  144. #Slackware can configure either an INTERNAL ethernet card, or an
  145. #EXTERNAL D-Link adaptor.
  146. #
  147. #Which type of ethernet device do you have?
  148. #EOF
  149. #  dialog --title "ETHERNET DEVICE SELECTION" --menu "`cat /tmp/tmpmsg`" 14 70 2 \
  150. #"Internal" "Internal ethernet card" \
  151. #"External" "External D-Link adaptor" 2> /tmp/enet
  152. #  if [ $? = 1 -o $? = 255 ]; then
  153. #   rm -f /tmp/tmpmsg /tmp/enet
  154. #   exit
  155. #  fi
  156. #  ENET_DEVICE="`cat /tmp/enet`"
  157. #  rm /tmp/enet
  158. #  if [ "$ENET_DEVICE" = "External" ]; then
  159. #   ENET_DEVICE="dl0"
  160. #  else
  161.    ENET_DEVICE="eth0" 
  162. #  fi
  163.  fi # ! UPNRUN
  164.  
  165.  cat << EOF > /tmp/tmpmsg
  166.  
  167.  There must be a directory on the server with the Slackware
  168.  sources for each disk in subdirectories beneath it.
  169.  
  170.  The installation script needs to know the name of the 
  171.  directory on your server that contains the disk 
  172.  subdirectories. For example, if your A3 disk is found at 
  173.  /slackware/a3, then you would respond: /slackware
  174.  
  175.  What is the Slackware source directory?
  176. EOF
  177.  dialog --title "SELECT SOURCE DIRECTORY" --inputbox "`cat /tmp/tmpmsg`" 17 65 2> /tmp/slacksrc
  178.  if [ $? = 1 -o $? = 255 ]; then
  179.   rm -f /tmp/tmpmsg /tmp/slacksrc
  180.   exit
  181.  fi
  182.  REMOTE_PATH="`cat /tmp/slacksrc`"
  183.  rm /tmp/slacksrc
  184.  reset
  185.  echo
  186.  echo 
  187.  echo
  188.  echo "We'll switch into text mode here so you can see if you have any errors."
  189.  echo
  190.  if [ ! "$UPNRUN" = "0" ]; then
  191.   echo
  192.   echo "We'll switch into text mode here so you can see if you have any errors."
  193.   echo
  194.   echo "Configuring ethernet card..."
  195.   ifconfig $ENET_DEVICE $LOCAL_IPADDR netmask $LOCAL_NETMASK broadcast $LOCAL_BROADCAST
  196.   route add -net $LOCAL_NETWORK
  197.   if [ "$HAVE_GATEWAY" = "0" ]; then
  198.    echo "Configuring your gateway..."
  199.    route add default gw $LOCAL_GATEWAY metric 1
  200.   fi
  201.  fi
  202.  echo "Mounting NFS..."
  203.  mount -t nfs $REMOTE_IPADDR:$REMOTE_PATH /var/adm/mount
  204.  echo "/var/adm/mount" > /tmp/SeTDS
  205.  echo "-source_mounted" > /tmp/SeTmount
  206.  echo "/dev/null" > /tmp/SeTsource
  207.  echo
  208.  echo "Current mount table:"
  209.  mount
  210.  echo -n "Do you think you need to try this again ([y]es, [n]o)? "
  211.  read TRY_AGAIN;
  212.  if [ "$TRY_AGAIN" = "n" ]; then
  213.   exit
  214.  fi
  215.  if [ "$UPNRUN" = "1" ]; then
  216.   route del $LOCAL_NETWORK
  217.   ifconfig $ENET_DEVICE down 
  218.  fi
  219. done
  220.