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