home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 033 / atcp40de.zip / INSTALL_ < prev    next >
Text File  |  1994-10-24  |  75KB  |  2,245 lines

  1. ;;;; Hey Emacs, this script might as well be -*- lisp -*-
  2. ;;;;
  3. ;;;; Install_AmiTCP - AmiTCP/IP installation script for Installer
  4. ;;;;
  5. ;;;; Copyright ⌐ 1994 AmiTCP/IP Group,
  6. ;;;;                  NSDi - Network Solutions Development Inc., Finland
  7. ;;;;                  All rights reserved.
  8. ;;;;
  9. ;;;; $Id: Install_AmiTCP,v 4.14 1994/10/24 20:57:34 jraja Exp $
  10. ;;;;
  11. ;;;; This script has been tested with Installer 1.24:
  12. ;;;;
  13. ;;;;     Installer and Installer project icon
  14. ;;;;     (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
  15. ;;;;     Reproduced and distributed under license from Commodore.
  16. ;;;;
  17. ;;;;     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  18. ;;;;     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  19. ;;;;     OR RESPONSIBILITY IS ASSUMED.
  20. ;;;;
  21. ;;;; Use following Icon tooltypes / Command line options:
  22. ;;;; APPNAME=AmiTCP/IP
  23. ;;;; MINUSER=AVERAGE
  24. ;;;;
  25. (welcome "    Welcome to the " @app-name " 4.0 demo version installation.\n")
  26. ;;;;
  27. ;;;; What we are?
  28. ;;;;
  29. (set app-name (cat @app-name " 4.0 demo version"))
  30.  
  31. ;;;;
  32. ;;;; "Needs"
  33. ;;;;
  34. (set need-version 37  ; version of operating system need by AmiTCP/IP
  35.      need-memory (* 512 1024))
  36. ;;;
  37. ;;; Destination directories of the AmiTCP/IP
  38. ;;;
  39. (set 
  40.  atcp-name "AmiTCP"
  41.  atcp-assign (cat atcp-name ":")    ; Assign to AmiTCP
  42.  ;; Exported files
  43.  export-dir (tackon atcp-assign "export")
  44.  ;; Configuration
  45.  conf-dir (tackon atcp-assign "db")
  46.  ;; User binaries
  47.  bin-dir (tackon atcp-assign "bin")
  48.  ;; documentation
  49.  doc-dir (tackon atcp-assign "doc")
  50.  ;; devices directory
  51.  devs-dir (tackon atcp-assign "devs")
  52.  ;; AmigaGuide documentation
  53.  help-dir (tackon atcp-assign "help")
  54.  ;; DOS handlers
  55.  l-dir (tackon atcp-assign "l")
  56.  ;; libraries
  57.  libs-dir (tackon atcp-assign "libs")
  58.  ;; daemons
  59.  serv-dir (tackon atcp-assign "serv")
  60.  ;; source
  61.  src-dir (tackon atcp-assign "src")
  62.  ;; includes for net applications
  63.  include-dir (tackon atcp-assign "netinclude")
  64.  ;; network link libraries
  65.  lib-dir (tackon atcp-assign "netlib")
  66.  ;;
  67.  ;; If you add directories above, then also add the name of the variable below.
  68.  ;; This is to have "for i in a b c d ..." construct
  69.  ;;
  70.  ;; These directories are always present
  71.  dir-pat (cat "(" "devs" "|" "db" "|" "bin" "|" "doc" "|" 
  72.           "help" "|" "l" "|" "libs" "|" "serv" ")")
  73.  ;; Optional directories
  74.  dir-pat-opt (cat "(" "netinclude" "|" "netlib" "|" "src" ")")
  75.  ;;
  76.  ;; The source directory name
  77.  source-dir (if (= 1 (exists @icon))
  78.             (pathonly (expandpath @icon))
  79.           (expandpath @icon))
  80.  ;;
  81.  ;; directories in exports
  82.  ;;
  83.  dist-networks-dir (tackon source-dir "export/Devs/Networks")
  84.  ;; Mounts
  85.  tcp-mount (cat 
  86.         "Assign TCP: Exists > NIL:\n" 
  87.         "IF Warn\n"
  88.         "  Mount TCP: from AmiTCP:devs/Inet-Mountlist\n"
  89.         "EndIf\n")
  90.  apipe-mount (cat 
  91.           "Assign APIPE: Exists > NIL:\n" 
  92.           "IF Warn\n"
  93.           "  Mount APIPE: from AmiTCP:devs/APipe-Mountlist\n"
  94.           "EndIf\n")
  95.  )
  96.  ;; How to get needed information?
  97. (set
  98.  net-setup-help
  99.      "    You can get this information from your network administration.\n")
  100.  
  101. ;;; copy "more" to ram: to be able to use it
  102. (set
  103.  pager-cmd (if (exists "ENV:PAGER" (noreq)) (getenv "PAGER"))
  104.  pager-cmd 
  105.  (if pager-cmd pager-cmd 
  106.    (if (exists "SYS:Utilities/More" (noreq))
  107.        ((copyfiles
  108.      (prompt "Copying sys:utilities/more to ram: for use")
  109.      (source "SYS:Utilities/More")
  110.      (dest   "RAM:")
  111.      (safe)
  112.      (optional "nofail"))
  113.     "RAM:More")
  114.      ("more"))))
  115.  
  116. ;; Return old AmiTCP: assign if we are aborting
  117. (onerror
  118.  (if old-atcp-directory
  119.      (makeassign atcp-name old-atcp-directory)))
  120.  
  121. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  122. (procedure
  123.  ask-ip-address
  124.  ;;  Procedure to ask an IP address
  125.  ;;
  126.  ;; arguments:
  127.  ;;  ::ask-ip-prompt   - Prompt text
  128.  ;;  ::ask-ip-help     - help text
  129.  ;;  ::ask-ip-need     - empty result allowed if not true
  130.  ;;  ::ask-ip-default  - default value for the asked IP address
  131.  ;;
  132.  ;; locally used names:
  133.  ;;  ::ask-ip-result
  134.  (set ::ask-ip-result "")
  135.  (while
  136.      ((set ::ask-ip-result
  137.        (askstring
  138.         (prompt ::ask-ip-prompt
  139.             (if (NOT ::ask-ip-need)
  140.             (cat "\nGive an empty string if you want to "
  141.                  "by-pass this option."))
  142.             (if ::ask-ip-result
  143.             (cat "\n\nYou entered an invalid value\n\""
  144.                  ::ask-ip-result "\".\n"
  145.                  "Enter a valid IP address.")))
  146.         (default ::ask-ip-default)
  147.         (help net-setup-help
  148.           ::ask-ip-help
  149.           "\n    Internet address is a string of at most four "
  150.           "decimal numbers separated by dots. For example, "
  151.           "\"130.233.161.40\" is a valid internet address.\n"
  152.           "    You will be asked again for the address, "
  153.           "if the address you entered is invalid.")))
  154.       ;; loop while answer is unacceptable
  155.       (if ::ask-ip-result
  156.       (NOT (patmatch "# #(1|2|3|4|5|6|7|8|9|0).#(1|2|3|4|5|6|7|8|9|0|.)# "
  157.              ::ask-ip-result))
  158.      ::ask-ip-need)))
  159.  ::ask-ip-result)
  160.  
  161. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  162. (procedure
  163.  check-system-version
  164.  ;; is your Exec recent enough?
  165.  (set exec-version (/ (getversion) 65536))
  166.  (transcript "Running on exec version " exec-version ".")
  167.  (if (< exec-version need-version)    ; check operating system version
  168.      ((message "The " @app-name " needs at least Exec version " need-version
  169.            " to run.\nYou have only version " exec-version ".\n"
  170.            "You can proceed with the installation, but consider "
  171.            "installing the " @app-name " with proper version of "
  172.            "the operating system."
  173.            (help
  174.         "    The " @app-name " uses some system functions "
  175.         "that are not present or functional in earlier system "
  176.         "versions. Consider updating your system.\n"
  177.         "    If you have a later version of operating system "
  178.         "and are only now using older version: be sure to use "
  179.         "only release 2.04 or newer with the " @app-name ". "
  180.         "No damage happens if you run the " @app-name " with an "
  181.         "earlier operating system, however. It just "
  182.         "refuses to start.\n"
  183.         "    If you decide to continue, no changes will be made to "
  184.         "system startup files, so you must edit them yourself. "
  185.         "Refer instructions for manual installation."))
  186.       (transcript "User decided to continue installation while running "
  187.           "on operating system release earlier than 2.04."))))
  188.  
  189.  
  190. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  191. (procedure
  192.  check-available-memory
  193.  ;;
  194.  (transcript "Checking available memory.")
  195.  (set avail-mem (+ (database "total-mem")))
  196.  (if (< avail-mem need-memory)
  197.      ((message "Your system has only " (/ avail-mem 1024) " kilobytes of "
  198.            "free memory, while the " @app-name " needs at least "
  199.            (/ need-memory 1024) " to be useful.\n"
  200.            "You can continue the installation but be warned!")
  201.       (transcript "User decided to continue installation while available "
  202.           "memory was below the recommended minimum."))))
  203.  
  204. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  205. (procedure
  206.  check-user-level
  207.  ;;
  208.  (transcript "Checking user level.")
  209.  (if (< @user-level 1)
  210.      ((transcript "Installation aborted due to too low user level.")
  211.       (abort "AmiTCP/IP installation requires at least the \"average\" "
  212.          "user level. Restart installation and select appropriate user "
  213.          "level."))))
  214.  
  215. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  216. (procedure
  217.  check-old-assign
  218.  ;; If there is already the AmiTCP/IP installed, store the assign
  219.  ;; to old-atcp-directory
  220.  (transcript "Checking for already installed AmiTCP.")
  221.  (if (exists atcp-assign (noreq))
  222.      (set old-atcp-directory (getassign atcp-name)))
  223.  (if old-atcp-directory
  224.      (transcript "Existing AmiTCP detected at directory " 
  225.          old-atcp-directory ".")))
  226.  
  227. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  228. (procedure
  229.  ask-accept-licence ;; Ask if the user accepts licence conditions
  230.  (transcript "Asking if the user accepts the licence conditions.")
  231. ;;
  232. ;; use "more" to show the full licence text
  233. ;;
  234.  (run (cat "run " pager-cmd) (tackon source-dir "LICENCE") (safe))
  235.  (message "\nAmiTCP/IP is a copyrighted propiertary software of "
  236.       "the Network Solutions Development Inc.\n"
  237.           "\nPlease read the shown licence text carefully.\n"
  238.           "\nBy proceeding the installation of this software you "
  239.       "indicate that you accept the licence conditions.\n"
  240.       )
  241.  )
  242.  
  243. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  244. (procedure
  245.  select-destination-directory
  246.  ;; Select destination directory for the installation. We suggest the user
  247.  ;; to install to the place from where the installer was started. This is
  248.  ;; since normally this software will be unarchived to its proper location
  249.  ;; and the files don't have to be copied any more.
  250.  ;;
  251.  (transcript "Selecting destination directory for the installation.")
  252.  (while
  253.      ((set @default-dest
  254.        (askdir
  255.         (prompt "Select directory where to install the " app-name ".\n"
  256.             "Most of the files don't have to be copied, if you accept "
  257.             "the offered default.")
  258.         (help "    Here you can specify location where to install "
  259.           "the " app-name ".\n"
  260.           "    Installation can be made on-place. "
  261.           "This is recommended if you have already unarchived "
  262.           "the " app-name " archive to its final location. "
  263.           "In this case "
  264.           "most of the files are left where they are. "
  265.           "Only necessary files are copied to different "
  266.           "positions.\n"
  267.           "    Installation must NOT be made on top of an older "
  268.           "version of the " @app-name ".")
  269.         (newpath)
  270.         (default source-dir)))
  271.       (if (= 2 (exists @default-dest))
  272.       ;; check that installation is not tried over the old version
  273.       (if (OR (exists (tackon @default-dest "bin/AmiTCP")) ; version 1.0
  274.           (> (getversion (tackon source-dir "AmiTCP"))
  275.              (if (exists (tackon @default-dest "AmiTCP"))
  276.              (getversion (tackon @default-dest "AmiTCP"))
  277.                $7FFFFFFF)))
  278.           ((message "You are possibly trying to install the " @app-name " "
  279.             "over an old version of it.\n"
  280.             "It is not allowed.\n"
  281.             "You should select some other directory or abort "
  282.             "the installation.")
  283.            1)
  284.         0)
  285.     ((makedir @default-dest
  286.          (infos))
  287.      0))))
  288.  
  289.  ;; Make the AmiTCP: assign
  290.  (makeassign atcp-name @default-dest))
  291.  
  292. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  293. (procedure
  294.  copy-files-to-destination ;;; Copy all files if not installing on-place
  295.  ;;
  296.  (if (= source-dir
  297.     (expandpath @default-dest))
  298.      (message "\nSource and destination directories are the same, "
  299.           "not copying."
  300.           (help "    The " app-name " files don't have to be copied, "
  301.             "since the source and the destination directories are "
  302.             "the same."))
  303.    ((transcript "Copying " app-name " files from " source-dir " to "
  304.         @default-dest ".")
  305.     (set dir-information
  306.      (cat
  307.       (if (exists "netinclude")
  308.           (cat "netinclude - include files needed for networking "
  309.            "applications development\n"))
  310.       (if (exists "netlib")
  311.          "netlib - link libraries for networking program development\n")
  312.       (if (exists "src")
  313.           (if (exists "src/util")
  314.           (cat "src - source code for libraries, examples"
  315.                "and all the binaries\n")
  316.         "src - source code for the libraries and examples\n"))
  317.       ))
  318.     (if (< 0 (strlen dir-information))
  319.     (if (askbool
  320.          (prompt "\nDo you want directories needed only with development "
  321.              "for the " @app-name " or applications to be copied?")
  322.          (help "    These directories (and their contents) is "
  323.            "not needed to use AmiTCP/IP. "
  324.            "You need to copy them only when you plan to "
  325.            "make network programs by yourself.\n"
  326.            "    Description of directories:\n"
  327.            dir-information
  328.            (if (= @user-level 1)
  329.                "    If you select EXPERT level at start, you "
  330.              "    You ")
  331.            "will be prompted for each directory.\n"))
  332.         (foreach
  333.          source-dir dir-pat-opt
  334.          (copyfiles
  335.           (source source-dir)
  336.           (choices (fileonly @each-name))
  337.           (confirm)
  338.           (dest @default-dest)
  339.           (prompt
  340.            (if (= @user-level 1)
  341.            "Copying files to selected location."
  342.          "Copy this directory?"))
  343.           (help "    Description of directories:\n"
  344.             dir-information)
  345.           (optional "askuser")))))
  346.     (foreach source-dir dir-pat
  347.          ((set dest-dir (tackon @default-dest @each-name))
  348.           (if (NOT (exists dest-dir))
  349.           (makedir dest-dir))
  350.           (copyfiles (all)
  351.              (source (expandpath @each-name))
  352.              (dest dest-dir)
  353.              (prompt "Copying files to the selected location.")
  354.              (optional "askuser"))))
  355.     (copyfiles (source source-dir)
  356.            (dest @default-dest)
  357.            (prompt "Copying files to the selected location.")
  358.            (pattern "#?")
  359.            (files)
  360.            (infos)
  361.            (optional "askuser"))))
  362.  ;;
  363.  ;; Create AmiTCP:log if it does not exist already
  364.  ;;
  365.  (if (NOT (= 2 (exists (tackon atcp-assign "log"))))
  366.      (makedir (tackon atcp-assign "log")))
  367.  ;;
  368.  ;; Create AmiTCP:log/wtmp if it does not exist already
  369.  ;; (This is to avoid unnecessary errors from the ftpd)
  370.  ;;
  371.  (if (NOT (= 1 (exists (tackon atcp-assign "log/wtmp"))))
  372.      (textfile (dest (tackon atcp-assign "log/wtmp"))))
  373.  ;;
  374.  ;; Add script flags to the scripts, pure flags to pure programs
  375.  ;;
  376.  (protect (tackon bin-dir "ch_nfsctl") "+s +e")
  377.  (protect (tackon bin-dir "netstat") "+s +e")
  378.  (protect (tackon bin-dir "SynClock") "+s +e")
  379.  (protect (tackon bin-dir "stopnet") "+s +e")
  380.  (if (exists src-dir)
  381.      ((protect (tackon src-dir "compile") "+s +e")
  382.       (protect (tackon src-dir "compile.lib") "+s +e")))
  383.  (protect (tackon bin-dir "NapsaTerm") "+p +e")
  384.  (protect (tackon serv-dir "in.fingerd") "+p +e")
  385.  (if (exists (tackon bin-dir "rcsrev"))
  386.      (protect (tackon bin-dir "rcsrev") "+p +e"))
  387.  )
  388.  
  389.  
  390. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  391. (procedure
  392.  ask-slip-config
  393.  ;;
  394.  ;; the my-host-if has to be set before this is called
  395.  ;;
  396.  ;; This sets the if-config-file on return ("" if not applicaple).
  397.  ;; The config file is returned without the path and it will be put to the 
  398.  ;; ENV:Sana2 directory by the generated startnet script.
  399.  ;; The contents is stored in if-config.
  400.  ;;
  401.  (transcript "Creating configuration file for SLIP/CSLIP devices.")
  402.  ;;
  403.  ;; Loop until the user is satisfied
  404.  ;;
  405.  (while
  406.      ((set my-serial-device
  407.        (askfile (prompt "Select the SERIAL device driver to be used with "
  408.                 my-host-if ":\n"
  409.                 "NOTE: This list lists all devices in DEVS:.\n"
  410.                 "Normally you would want to select "
  411.                 "`serial.device'."
  412.                 )
  413.             (default "DEVS:serial.device")
  414.             (help "    You should select the serial device driver to "
  415.               "be used for the transport of " my-host-if ". "
  416.               "You will be separately asked for the unit number.\n"
  417.               "    You can cancel this operation by giving an "
  418.               "empty string.")))
  419.       (if (= 1 (exists my-serial-device))
  420.       ;;
  421.       ;; remove the prefix from the file name
  422.       ;;
  423.       ((if (patmatch "DEVS:#?" my-serial-device)
  424.            (set my-serial-device (substr my-serial-device 5)))
  425.        
  426.        (set my-serial-unit
  427.         (asknumber
  428.          (prompt "\nSelect unit number for the " my-serial-device ":")
  429.          (default 0)
  430.          (help "    Select the unit number for the device "
  431.                my-serial-device " to use. This is 0 for the "
  432.                "internal serial port, but might be other for "
  433.                "other serial devices."))
  434.         my-serial-baud
  435.         (asknumber
  436.          (prompt "\nGive the baud rate for the " my-serial-device 
  437.              " unit " my-serial-unit ".\n"
  438.              "\nPlease start with a low value like 9600, "
  439.              "if you are not absolutely sure that your SLIP "
  440.              "line works at higher speeds.\n")
  441.          (default 9600)
  442.          (help "    The baud rate MUST match the one used while "
  443.                "dialling to the SLIP provider.\n"
  444.                "    Since higher speeds may have some problems, you "
  445.                "should always start with some reasonably low baud "
  446.                "rate (like 9600) and then, when your SLIP setup "
  447.                "works, try out the higher speeds."))
  448.         my-slip-mtu-raw
  449.         (asknumber
  450.          (prompt "\nGive the Maximum Transfer Unit (MTU) for the "
  451.              my-host-if ":\n")
  452.          (range 576 1500)
  453.          (default 1006)
  454.          (help "    The MTU MUST match the one used by your SLIP "
  455.                "provider.\n"
  456.                "    The value 1006 bytes is the most common, but 1500 "
  457.                "bytes is also used often.\n"
  458.                "    You should consult your SLIP provider for the "
  459.                "correct value to use."))
  460.         ;; Force the MTU to be even
  461.         my-slip-mtu
  462.         (* (/ (+ 1 my-slip-mtu-raw) 2) 2)
  463.         my-slip-options-bitmap
  464.         (askoptions
  465.          (prompt "\nSelect additional options to be used with the "
  466.              my-host-if ":\n"
  467.              "\nPlease see Help for explanations for each option.")
  468.          (choices "Carrier Detect" "Hardware-handshake (CTS/RTS)"
  469.               "EOF-mode")
  470.          (default %010)
  471.          (help "    Carrier Detect (CD): "
  472.                "If selected, causes the " my-host-if " to pay "
  473.                "attention to the status of the carrier detect line. "
  474.                "If this isn't selected, the CD signal will be "
  475.                "ignored.\n"
  476.                "    Hardware-handshake (7WIRE): "
  477.                "If selected, the seven wire (or hardware, i.e., "
  478.                "CTS/RTS) handshaking is used with the modem. "
  479.                "This option is strongly recommended for high baud "
  480.                "rates.\n"
  481.                "    EOF-mode (EOFMODE): "
  482.                "If selected, causes " my-host-if " to use EOFMODE. "
  483.                "This reduces the CPU load considerably, but it "
  484.                "won't work with all different (buggy) serial "
  485.                "devices (like the a2232)."))
  486.         my-slip-options
  487.         (cat (if (in my-slip-options-bitmap 0)
  488.              "CD ")
  489.              (if (in my-slip-options-bitmap 1)
  490.              "7WIRE ")
  491.              (if (in my-slip-options-bitmap 2)
  492.              "EOFMODE"))
  493.         )
  494.        
  495.        (if (not (askbool
  496.              (prompt
  497.               "This is the information you gave for the configuration "
  498.               "for the " my-host-if ":\n"
  499.               "\nSerial device: " my-serial-device
  500.               "\nSerial unit: " my-serial-unit
  501.               "\nSerial baud rate: " my-serial-baud
  502.               "\nSLIP MTU: " my-slip-mtu
  503.               "\nSLIP options: " my-slip-options
  504.               "\n\nIs this correct?")
  505.              (help
  506.               "    Check the information shown. If you do not "
  507.               "confirm it, all of it will be asked again.")))
  508.            1            ; ask it all again
  509.          (
  510.           ;; store the file name and the configuration string
  511.           (set if-config-file my-host-if)
  512.           (if (= my-host-if "rhcslip0") ;; special case
  513.           (set if-config-file "rhslip0"))
  514.           (set if-config-file
  515.            (cat if-config-file ".config"))
  516.           (set if-config
  517.            (cat my-serial-device " "
  518.             my-serial-unit " "
  519.             my-serial-baud " "
  520.             "0.0.0.0 "
  521.             "MTU=" my-slip-mtu " "
  522.             my-slip-options))
  523.           0                ; no need to ask again
  524.           ))))
  525.       )
  526.    )
  527.  )
  528.  
  529. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  530. (procedure
  531.  ask-ggbus-config
  532.  ;;
  533.  ;; the my-host-if has to be set before this is called
  534.  ;;
  535.  ;; this sets the if-config-file on return ("" if not applicaple)
  536.  ;; the contents is stored in if-config
  537.  ;;
  538.  (transcript "Creating configuration file for GGBus+ devices.")
  539.  ;;
  540.  ;; Common help
  541.  ;;
  542.  (set isa-help (cat "    Refer to the ISA board and GGBus+ manuals for more "
  543.             "information."))
  544.  
  545.  ;;
  546.  ;; Loop until the user is satisfied
  547.  ;;
  548.  (while
  549.      ((set my-isa-irq
  550.        (asknumber
  551.         (prompt "\nGive the ISA IRQ number for the " my-host-if ":")
  552.         (default 3)
  553.         (if (= my-host-if "gg_smc")
  554.         (range 3 5)
  555.           (range 1 15)
  556.           )
  557.         (help "    Give the ISA IRQ number for the interface "
  558.           my-host-if " to use. The given number must match "
  559.           "with the setting on the board.\n" isa-help))
  560.        my-isa-ioaddr
  561.        (askstring
  562.         (prompt "\nGive the ISA I/O-address of the " my-host-if ".\n"
  563.             "\nThe address must be entered in hex, starting with "
  564.             "\"0x\".\n")
  565.         (default "0x300")
  566.         (help "    The given I/O-address must match with the setting "
  567.           "on the board.\n" isa-help))
  568.        my-isa-memaddr
  569.        (if (= my-host-if "gg_smc")
  570.            (askstring
  571.         (prompt "\nGive the ISA memory base address for the "
  572.             my-host-if ".\n" 
  573.             "\nThe address must be entered in hex, starting with "
  574.             "\"0x\".\n")
  575.         (default "0xd0000")
  576.         (help "    The given base address must match with the setting "
  577.               "on the board.\n" isa-help))))
  578.        
  579.       (if (not (askbool
  580.         (prompt
  581.          "This is the information you gave for the configuration "
  582.          "for the " my-host-if ":\n"
  583.          "\nISA IRQ number: " my-isa-irq
  584.          "\nISA I/O-address: " my-isa-ioaddr
  585.          (if my-isa-memaddr
  586.              (cat "\nISA memory base address: " my-isa-memaddr))
  587.          "\n\nIs this correct?")
  588.         (help
  589.          "    Check the information shown. If you do not "
  590.          "confirm it, all of it will be asked again.")))
  591.       1            ; ask it all again
  592.     (
  593.      ;; store the file name and the configuration string
  594.      (set if-config-file (cat my-host-if ".config_0"))
  595.      (set if-config
  596.           (cat "IRQ=" my-isa-irq " "
  597.            "IOADDR=" my-isa-ioaddr " "
  598.            (if my-isa-memaddr
  599.                (cat "MEMADDR=" my-isa-memaddr " "))
  600.            ))
  601.      0                ; no need to ask again
  602.      )))
  603.    )
  604.  )
  605.  
  606. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  607. (procedure
  608.  update-devices
  609.  (transcript "Updating Sana-II device drivers.")
  610.  ;;
  611.  ;; Create directory DEVS:Networks if it does not exist already
  612.  ;;
  613.  (if (NOT (= 2 (exists "DEVS:Networks")))
  614.      (makedir "DEVS:Networks"))
  615.  ;;
  616.  ;; Copy each driver in the distribution to the DEVS:Networks if necessary
  617.  ;;
  618.  (working "Checking Sana-II device drivers...")
  619.  (if (= 2 (exists dist-networks-dir))
  620.      (foreach
  621.        dist-networks-dir "#?.device"
  622.        ((set dist-name (tackon dist-networks-dir @each-name)
  623.          devs-name (tackon "DEVS:Networks" @each-name)
  624.          dist-version (getversion dist-name)
  625.          copy-it (NOT (exists devs-name)))
  626.     ;;
  627.     ;; Check if the driver should be copied over
  628.     ;;
  629.     (if (NOT copy-it)
  630.         (set copy-it
  631.                  ; or if the driver in DEVS:Networks is of older version
  632.          (< (set devs-version (getversion devs-name)) dist-version)))
  633.     (if (NOT copy-it)
  634.         (set copy-it
  635.              ; or if the files are of the same version but different
  636.          (set sum-differs (if (= dist-version devs-version)
  637.                       (<> (getsum dist-name)
  638.                       (getsum devs-name))
  639.                     0))))
  640.     (if copy-it
  641.         (copyfiles
  642.          (prompt "Should this Sana-II driver be installed in Devs:Networks?\n"
  643.              (if devs-version
  644.              (cat "A driver with the same name exists already"
  645.                   (if sum-differs
  646.                   (cat ", it has the same version, but the "
  647.                        "files are not the same.")
  648.                 (cat ", but the driver in the "
  649.                      "DEVS:Networks is of older version.")))
  650.                ""))
  651.          (help
  652.           "    The Sana-II drivers should be located in "
  653.           "the DEVS:Networks directory.\n"
  654.           "    This directory is the official location for the Sana-II "
  655.           "device drivers.")
  656.          (source (pathonly dist-name))
  657.          (choices (fileonly dist-name))
  658.          (dest "DEVS:Networks")
  659.          (files)
  660.          (optional "nofail" "askuser")
  661.          (confirm "average"))))))
  662.  
  663.  ;;; ask user which export/Env/Sana2 files should be copied
  664.  (if (= 2 (exists (tackon source-dir "export/Env/Sana2")))
  665.      (if
  666.      (askbool (prompt "\nDo you want to install example Sana-II "
  667.               "configuration files?\n"
  668.               "Copies will be confirmed.")
  669.           (help "    This release contains example configuration "
  670.             "files for the SLIP devices and Agnet (a Sana-II "
  671.             "pseudo device).\n"
  672.             "    The copying of each file will confirmed.")
  673.           (default 1))
  674.      (copyfiles
  675.       (prompt "Select Sana-II configuration files to be copied:")
  676.       (help "    These configuration files are for example only. "
  677.         "You need to edit them for them to be useful. Refer to "
  678.         "the documentation of the Sana-II device in question. "
  679.         "The AmiTCP:doc directory contains documentation for "
  680.         "the drivers included in this release.\n"
  681.         "    The files will be copied to the ENVARC: by default. "
  682.         "Normally they will be copied to ENV: on next reboot.")
  683.       (source (tackon source-dir "export/Env/Sana2"))
  684.       (dest "ENVARC:sana2")
  685.       (all)
  686.       (files)
  687.       (optional "nofail" "askuser")
  688.       (confirm "average")))
  689.    ))
  690.  
  691. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  692. (procedure
  693.  ask-update-devices
  694.  (if (= 2 (exists dist-networks-dir))
  695.      (if (askbool
  696.       (prompt "\nDo you want to update your Sana-II network device "
  697.           "drivers?\n"
  698.           "Each copy will be confirmed.")
  699.           (help
  700.            "    Each new AmiTCP/IP distribution usually contains "
  701.            "updated versions of some of the provided Sana-II network "
  702.            "device drivers. If you choose \"Yes\", this installation "
  703.            "script will check for each device, if this is the case."))
  704.          (update-devices)
  705.        (transcript "User did not want to update Sana-II drivers."))
  706.    (transcript "Directory " dist-networks-dir " not found.")))
  707.  
  708. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  709. (procedure
  710.  ask-if-dynamic ;; Ask if the network connection is dynamic
  711.  (set is-if-dynamic
  712.       (askbool (prompt "\nIs your network connection dynamic?")
  713.            (help "    If your network connection is dynamic, your IP "
  714.              "address will change each time you connect to the "
  715.              "network. Because of this you can not have a "
  716.              "fixed host name either. If this is the case, "
  717.              "you will not be asked for the host name.\n"
  718.              "    If your network connection is not "
  719.              "dynamic, then you should have a fixed IP address.\n"
  720.              "    The \"startnet\" script produced by this "
  721.              "installation script will have an optional IP "
  722.              "address argument, which you should use if your "
  723.              "network connection is dynamic.\n")
  724.            (default 0)))
  725.  )
  726.  
  727. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  728. (procedure
  729.  ask-hostname ;; Get host name, domain and aliases
  730.  ;;
  731.  ;; Get the hostname from environment variable
  732.  ;;
  733.  (set def-full-name (if (exists "ENV:HOSTNAME")
  734.             (getenv "HOSTNAME")
  735.               "")
  736.       my-host-name ""
  737.       my-host-aliases ""
  738.       my-domain-name "")
  739.  ;;
  740.  ;; Break the name into the host and domain parts
  741.  ;;
  742.  (set ::index 0
  743.       ::length (strlen def-full-name))
  744.  (while (AND (< ::index ::length)
  745.          (NOT (= (substr def-full-name ::index 1) ".")))
  746.    (set ::index (+ ::index 1)))
  747.  (if (= ::index ::length)
  748.      (set def-host-name ""
  749.       def-domain-name "")
  750.    (set def-host-name (substr def-full-name 0 ::index)
  751.     def-domain-name (substr def-full-name (+ ::index 1))))
  752.  ;;
  753.  ;; If the network connection is dynamic, do not ask the host name, but leave
  754.  ;; it empty.
  755.  ;;
  756.  (if (not is-if-dynamic)
  757.      ;;
  758.      ;; Ask the host name from the user
  759.      ;;
  760.      (while (OR (= my-host-name "")
  761.         ;; check that name has no dots
  762.         ((set ::index 0
  763.               ::length (strlen my-host-name))
  764.          (while (AND (< ::index ::length)
  765.                  (NOT (= (substr my-host-name ::index 1) ".")))
  766.            (set ::index (+ ::index 1)))
  767.          (NOT (= ::index ::length))))
  768.        (set my-host-name
  769.         (askstring
  770.          (prompt
  771.           (cat "\nEnter the host name of your computer (not including "
  772.            "domain)"
  773.            (if (= my-host-name "")
  774.                ":"
  775.              (cat ".\nThe value " my-host-name " is illegal, since it "
  776.               "contains a dot."))))
  777.          (help net-setup-help
  778.            "    Host name is a string NOT containing dots (.), "
  779.            "example: \"my-amiga\".\n"
  780.            "    Domain specifies the administrative domain of the "
  781.            "network where your host is connected. For example, "
  782.            "\"nsdi.fi\" is the domain name of the Network "
  783.            "Solutions Development Inc., Finland.\n")
  784.          (default def-host-name))))
  785.    )
  786.  ;;
  787.  ;; ask the domain name from the user
  788.  ;;
  789.  (set my-domain-name
  790.       (askstring
  791.        (prompt (if is-if-dynamic 
  792.            "\nEnter your domain name:"
  793.          "\nEnter the domain part of your host name:"))
  794.        (help net-setup-help
  795.          "    Domain specifies the administrative domain of the "
  796.          "network where your host is connected. For example, "
  797.          "\"nsdi.fi\" is the domain name of the Network "
  798.          "Solutions Development Inc., Finland.\n"
  799.          "    If you do not have a domain name server, then you might "
  800.          " not have a domain, either. In this case you can leave the "
  801.          "domain empty.\n")
  802.        (default def-domain-name)))
  803.  ;;
  804.  ;; Set the full name of this host. 
  805.  ;;
  806.  (set my-full-name (if my-host-name
  807.                (cat my-host-name
  808.                 (if my-domain-name
  809.                 (cat "." my-domain-name)
  810.                   ""))))
  811.  ;;
  812.  ;; ask alias names for this host if the host name is not empty
  813.  ;;
  814.  (if my-host-name
  815.      (while
  816.      (set new-host-name
  817.           (askstring
  818.            (prompt "Give aliases to your computer " my-full-name
  819.                " one at a time."
  820.                (if my-host-aliases
  821.                (cat "\n\nAliases are:\n" my-host-aliases)))
  822.            (default "")
  823.            (help net-setup-help
  824.              "    Your computer may have additional names "
  825.              "(aliases) to its official name.\n"
  826.              "    The plain host name (" my-host-name ") will "
  827.              "be understood by the " app-name " automatically, so "
  828.              "you do not need to include that as an alias. "
  829.              )))
  830.        (set my-host-aliases (cat my-host-aliases " " new-host-name))))
  831.  )
  832.  
  833. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  834. ;;;
  835. ;;; Ask network interfaces
  836. ;;;
  837. ;;; Loop until no device is given.
  838. ;;;
  839. (procedure
  840.  ask-interfaces
  841.  
  842.  (set number-of-interfaces 0)
  843.  
  844.  ;;
  845.  ;; Procedure to ask the network device driver name
  846.  ;;
  847.  ;; (Returns TRUE if an interface was selected)
  848.  ;;
  849.  ;; NOTE: Currently only 8 choises within each interface type are allowed
  850.  ;;       (excluding the "none" entry).
  851.  ;; 
  852.  (procedure
  853.   if-ask-device
  854.   (set my-host-if-type
  855.        ((set choice
  856.          (askchoice
  857.           (prompt (cat "Select "
  858.                (if (= number-of-interfaces 0)
  859.                    "the"
  860.                  "another")
  861.                " network interface type to be used:")
  862.               (help "    You should select your network interface "
  863.                 "type from the given choices. If your device type "
  864.                 "is "
  865.                 "not listed select some other (which matches "
  866.                 "closest to your device) and alter "
  867.                 "the installation (and db/interfaces file) "
  868.                 "by hand.\n"
  869.                 "    Select \"None\" if you do not want to "
  870.                 "configure "
  871.                 (if (= number-of-interfaces 0)
  872.                 "an"
  873.                   "another")
  874.                 " interface.")
  875.               (choices "None"            ; 0
  876.                    "SLIP/CSLIP"        ; 1
  877.                    "PPP"            ; 2
  878.                    "X.25"            ; 3
  879.                    "Ethernet"        ; 4
  880.                    "Arcnet"            ; 5
  881.                    "GGBus+ Ethernet"    ; 6
  882. ;; Not yet                   "Village Tronic Liana"   ; 7
  883.                    )
  884.               (default 0))))
  885.     ;;;
  886.     ;;; Destination IP address is asked for p-to-p interfaces only
  887.     ;;; also, the destination IP address suffices as the default 
  888.     ;;; gateway address in most cases.
  889.     ;;;
  890.     (set my-host-if-point-to-point (select choice
  891.                            0    ; None
  892.                            1    ; slip/cslip
  893.                            1    ; ppp
  894.                            0    ; x.25
  895.                            0    ; ethernet
  896.                            0    ; arcnet
  897.                            0    ; GGBus+ Ethernet
  898.                            0    ; VT Liana
  899.                            ))
  900.     choice)
  901.        
  902.        my-host-if
  903.        (if (= my-host-if-type 0)
  904.        ""
  905.      ((set choice
  906.            (askchoice
  907.         (prompt (cat "Select "
  908.                  (if (= number-of-interfaces 0)
  909.                  "the"
  910.                    "another")
  911.                  " network interface to be used:"))
  912.         (help "    You should select your network interface "
  913.               "from the given choices. If your device is "
  914.               "not listed select some other (which matches "
  915.               "closest to your device) and alter "
  916.               "the installation (and db/interfaces file) "
  917.               "by hand.\n"
  918.               "    Select \"None\" if you do not want to "
  919.               "configure "
  920.               (if (= number-of-interfaces 0)
  921.               "an"
  922.             "another")
  923.               " interface.")
  924.         (select (- my-host-if-type 1)
  925.             (            ; type 1 (SLIP/CSLIP)
  926.              (choices "None"    ; 0
  927.                   "rhslip"    ; 1
  928.                   "rhcslip"    ; 2
  929.                   )
  930.              (default 1))
  931.             (            ; type 2 (PPP)
  932.              (choices "None"    ; 0
  933.                   "ppp"        ; 1
  934.                   )
  935.              (default 1))
  936.             (            ; type 3 (AX.25)
  937.              (choices "None"    ; 0
  938.                   "axdm"    ; 1
  939.                   )
  940.              (default 1))
  941.             (            ; type 4 (Ethernet)
  942.              (choices "None"    ; 0
  943.                   "CBM A2065"    ; 1
  944.                   "Hydra Ethernet" ; 2
  945.                   "Golden Gate wd80xx (trossi)" ; 3
  946.                   "ASDG EB920"    ; 4
  947.                   "Village Tronic Ariadne" ; 5
  948.                   )
  949.              (default 1))
  950.             (            ; type 5 (Arcnet)
  951.              (choices "None"    ; 0
  952.                   "CBM A2060"    ; 1
  953.                   )
  954.              (default 1))
  955.             (            ; type 6 (GGBus+ Ethernet)
  956.              (choices "None"    ; 0
  957.                   "3COM 3C503"    ; 1
  958.                   "NE1000"     ; 2
  959.                   "NE2000"     ; 3
  960.                   "WD80x3"    ; 4
  961.                   )
  962.              (default 3))
  963.             (            ; type 7 (Liana)
  964.              (choices "None"    ; 0
  965.                   "Liana unit 0" ; 1
  966.                   "Liana unit 1" ; 2
  967.                   )
  968.              (default 1))
  969.             )
  970.         ))
  971.       (if (= choice 0)
  972.           ""
  973.         ;;;
  974.         ;;; Following names must match the ones defined in db/interfaces
  975.         ;;;
  976.         (select (+ (* (- my-host-if-type 1) 8) (- choice 1))
  977.                     ; type 1 (SLIP/CSLIP)
  978.             "slip0"    ; (1) 
  979.             "cslip0"    ; (2)
  980.             ""        ; (3)
  981.             ""        ; (4)
  982.             ""        ; (5)
  983.             ""        ; (6)
  984.             ""        ; (7)
  985.             ""        ; (8)
  986.                     ; type 2 (PPP)
  987.             "ppp0"    ; (1) 
  988.             ""        ; (2)
  989.             ""        ; (3)
  990.             ""        ; (4)
  991.             ""        ; (5)
  992.             ""        ; (6)
  993.             ""        ; (7)
  994.             ""        ; (8)
  995.                     ; type 3 (AX.25)
  996.             "ax25"    ; (1) 
  997.             ""        ; (2)
  998.             ""        ; (3)
  999.             ""        ; (4)
  1000.             ""        ; (5)
  1001.             ""        ; (6)
  1002.             ""        ; (7)
  1003.             ""        ; (8)
  1004.                     ; type 4 (Ethernet)
  1005.             "a2065"    ; (1) 
  1006.             "hydra"    ; (2)
  1007.             "wd80xx"    ; (3)
  1008.             "eb920"    ; (4)
  1009.             "ariadne"    ; (5)
  1010.             ""        ; (6)
  1011.             ""        ; (7)
  1012.             ""        ; (8)
  1013.                     ; type 5 (Arcnet)
  1014.             "a2060"    ; (1) 
  1015.             ""        ; (2)
  1016.             ""        ; (3)
  1017.             ""        ; (4)
  1018.             ""        ; (5)
  1019.             ""        ; (6)
  1020.             ""        ; (7)
  1021.             ""        ; (8)
  1022.                     ; type 6 (GGBus+ Ethernet)
  1023.             "gg_3c503"    ; (1) 
  1024.             "gg_ne1000"    ; (2)
  1025.             "gg_ne2000"    ; (3)
  1026.             "gg_smc"    ; (4)
  1027.             ""        ; (5)
  1028.             ""        ; (6)
  1029.             ""        ; (7)
  1030.             ""        ; (8)
  1031.                     ; type 7 (Village Tronic Liana)
  1032.             "liana0"    ; (1) 
  1033.             "liana1"    ; (2)
  1034.             ""        ; (3)
  1035.             ""        ; (4)
  1036.             ""        ; (5)
  1037.             ""        ; (6)
  1038.             ""        ; (7)
  1039.             ""        ; (8)
  1040.             ))))))
  1041.  
  1042.  ;;
  1043.  ;; Ask for the unit number
  1044.  ;;
  1045.  ;; NOTE: Currently not used
  1046.  ;;
  1047.  (procedure
  1048.   if-ask-unit
  1049.   (set my-host-if-unit
  1050.        (asknumber
  1051.     (prompt "\nSelect unit number for the " my-host-if ":")
  1052.     (default 0)
  1053.     (help "    Select the unit number for the interface "
  1054.           my-host-if " to use. This is usually 0 for the first "
  1055.           "unit of that particular network interface. "
  1056.           "The network interface unit numbers are normally directly "
  1057.           "mapped to the Sana-II device driver unit numbers. "
  1058.           "Refer your device driver documentation for "
  1059.           "correct number to use."))))
  1060.  
  1061.  ;;
  1062.  ;; Ask for the IP address of this host
  1063.  ;;
  1064.  (procedure
  1065.   if-ask-address
  1066.   (set ::ask-ip-prompt (cat
  1067.             (if is-if-dynamic
  1068.                 (cat 
  1069.                  "Your IP address is dynamic, but you still "
  1070.                  "should give a default "))
  1071.             "IP address for the interface " my-host-if ".\n"
  1072.             (if is-if-dynamic
  1073.                 (cat 
  1074.                  "When you start the " app-name " "
  1075.                  "with \"startnet\", "
  1076.                  "You should give the correct IP address as an "
  1077.                  "argument to override the default.")))
  1078.        ::ask-ip-help (cat "    If you have no connection to the global "
  1079.               "Internet and are configuring a private network, "
  1080.               "you can select your IP addresses from following "
  1081.               "ranges: (see RFC1597)\n\n"
  1082.               "10.0.0.0 - 10.255.255.255\n"
  1083.               "172.16.0.0 - 172.31.255.255\n"
  1084.               "192.168.0.0 - 192.168.255.255\n\n"
  1085.               "NOTE: The addresses at the end of the ranges are "
  1086.               "NOT usable IP addresses for a host! So select your "
  1087.               "address from INSIDE the range (for example: "
  1088.               "10.1.1.1).")
  1089.        ::ask-ip-need 1
  1090.        ::ask-ip-default ""
  1091.        my-host-addr (ask-ip-address)))
  1092.  
  1093.  ;;
  1094.  ;; Ask for the destination address for the point-to-point interfaces
  1095.  ;;
  1096.  (procedure
  1097.   if-ask-dest-address
  1098.   (set dest-host
  1099.        (if my-host-if-point-to-point
  1100.        ((set ::ask-ip-prompt 
  1101.          (cat "Give the destination address for the "
  1102.               "point-to-point interface " my-host-if ".\n"
  1103.               "Address of interface is " my-host-addr ".\n"
  1104.               "\n"
  1105.               "Normally this is the same as the default gateway "
  1106.               "address.\n"
  1107.               )
  1108.          ::ask-ip-help 
  1109.          (cat "    A point-to-point interface is one that is "
  1110.               "connected to a medium which only two hosts can "
  1111.               "attach, for example the normal serial line: "
  1112.               "your computer is in other end and the other "
  1113.               "computer is on the other end.\n"
  1114.               "    The destination address of an point-to-point "
  1115.               "interface is the IP address of the host (or "
  1116.               "terminal server) at the other end of the link.\n"
  1117.               "    If the destination address is not known for "
  1118.               "some reason, and you are going to configure only "
  1119.               "one interface, you can use the default gateway "
  1120.               "address as your p-to-p destination address.")
  1121.          ::ask-ip-need 1
  1122.          ::ask-ip-default ""
  1123.          )
  1124.         (ask-ip-address))
  1125.      "")))
  1126.     
  1127.  ;;
  1128.  ;; Ask for the netmask for this interface. If nothing is given,
  1129.  ;; a default value will be used by the ifconfig.
  1130.  ;;
  1131.  (procedure
  1132.   if-ask-netmask
  1133.   (set my-host-netmask
  1134.        ((set ::ask-ip-prompt
  1135.          (cat "Give netmask of the network on the interface " my-host-if
  1136.           ".\n"
  1137.           "Address of the interface is " my-host-addr
  1138.           (if dest-host
  1139.               (cat ",\ndestination address is " dest-host ".\n")
  1140.             (cat ".\n")))
  1141.          ::ask-ip-help 
  1142.          (cat "    Netmask is a dot separated string of four "
  1143.           "decimal numbers (similar to an internet address), "
  1144.           "which specifies which bits of the host's IP address "
  1145.           "are used to identify the network (the network address).\n"
  1146.           "    For example, \"255.255.255.0\" "
  1147.           "is a possible netmask.\n"
  1148.           "    The netmask must be the same for all the interfaces "
  1149.           "connected to the same network.\n"
  1150.           "    If you do NOT know the netmask, then leave "
  1151.           "it empty, a default value will be computed from "
  1152.           "your interface's IP address. This is correct only if "
  1153.           "the network is not divided into subnets.")
  1154.          ::ask-ip-need 0
  1155.          ::ask-ip-default ""
  1156.          )
  1157.     (ask-ip-address))))
  1158.  
  1159.  ;;
  1160.  ;; Ask for confirmation on given information
  1161.  ;;
  1162.  (procedure
  1163.   if-confirmation
  1164.   (askbool
  1165.    (prompt "This is the information you gave for this interface:\n"
  1166.        "\nInterface: " my-host-if
  1167.        "\nInterface address: " my-host-addr
  1168.        (if dest-host
  1169.            (cat "\nDestination address: " dest-host)
  1170.          "")
  1171.        "\nNetmask: " (if my-host-netmask
  1172.                  my-host-netmask
  1173.                "<use default>")
  1174.        "\n\nIs this correct?")
  1175.    (help "    Check the information shown. If you do not confirm it, "
  1176.      "all of it will be asked again.")))
  1177.  
  1178.  ;;
  1179.  ;; Ask if user wants to install another interface
  1180.  ;;
  1181.  (procedure
  1182.   if-ask-another
  1183.   (askbool
  1184.    (prompt "Do you want to install another interface?")
  1185.    (help "    You have already configured " number-of-interfaces 
  1186.      " interfaces. Select \"Yes\" if you want to configure yet "
  1187.      "another interface.")))
  1188.  
  1189.  ;;
  1190.  ;; Set startup string to contain configuration for the loopback device
  1191.  ;; (Other information will be later appeneded to this string variable).
  1192.  ;;
  1193.  (set 
  1194.       ;; a complete list for IP address to host name mappings..
  1195.       ;; (only one mapping for now)
  1196.       address-mapping "")
  1197.  ;;
  1198.  ;; Ask for interfaces
  1199.  ;;
  1200.  (while
  1201.      (if ((if-ask-device)
  1202.      ((if-ask-address)
  1203.       (if-ask-dest-address)
  1204.       (if-ask-netmask)
  1205.       (if (if-confirmation)
  1206.           ((transcript "Adding interface " my-host-if)
  1207.            ;;
  1208.            ;; Ask interface configuration. First the 'if-config-file'
  1209.            ;; is cleared. Following calls change it if necessary. Later
  1210.            ;; the config file is created if this variable is non-nil
  1211.            ;;
  1212.            (set if-config-file "")
  1213.            (if (= my-host-if-type 1)
  1214.            (ask-slip-config))
  1215.            (if (= my-host-if-type 6)
  1216.            (ask-ggbus-config))
  1217.            (set
  1218.         number-of-interfaces (+ number-of-interfaces 1)
  1219.         )
  1220.            0) ;; (if-ask-another) only one interface for now
  1221.         1) ;;; confirmation not given, ask again
  1222.       ))))
  1223.  )
  1224. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1225. (procedure
  1226.  ask-gateway ;;; Ask the default gateway address
  1227.  ;;
  1228.  (set ::ask-ip-prompt (cat
  1229.                "Enter the IP address of the default gateway"
  1230.                (if (AND (= number-of-interfaces 1)
  1231.                 my-host-if-point-to-point)
  1232.                (cat 
  1233.                 ". Since you have configured only one interface, "
  1234.                 "and that interface is of point-to-point type, "
  1235.                 "the destination address of the interface is "
  1236.                 "offered as default value. Generally you can "
  1237.                 "accept this default.")
  1238.              ":")
  1239.                )
  1240.       ::ask-ip-help (cat
  1241.              "    All network packets for destinations for which "
  1242.              "there is no defined route, are sent to the default "
  1243.              "gateway, which (hopefully) can send them towards "
  1244.              "the destination host.\n"
  1245.              "    The IP address (instead of a name) is needed, "
  1246.              "because the name may not be resolved without the "
  1247.              "gateway, if the name server is not "
  1248.              "in your local network.")
  1249.       ::ask-ip-need 0
  1250.       ::ask-ip-default (if (AND (= number-of-interfaces 1)
  1251.                 my-host-if-point-to-point)
  1252.                dest-host
  1253.              "")
  1254.       def-gateway-addr (ask-ip-address))
  1255.  ;;
  1256.  )
  1257.  
  1258. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1259. ;;
  1260. ;; resolv.conf configuration
  1261. ;;
  1262. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1263. ;;
  1264. (procedure
  1265.  ask-nameservers ;;; Ask addresses to the name servers
  1266.  ;;
  1267.  (set name-server-list ""
  1268.       name-server-text-list "")
  1269.  (while
  1270.      (set ::ask-ip-prompt
  1271.       (cat "Enter the IP addresses of the name servers (one at a time). "
  1272.            "The name servers will be searched in the given order.\n"
  1273.            (if name-server-text-list
  1274.            ("\nIncluded name servers are: %s\n"
  1275.             name-server-text-list)))
  1276.       ::ask-ip-help
  1277.       (cat "    A name server is used to resolve host "
  1278.            "names to internet addresses. This allows you "
  1279.            "to use symbolic names for the hosts instead "
  1280.            "of internet addresses.\n"
  1281.            "    In Unix systems the name server addresses are "
  1282.            "usually stored into the file `/etc/resolv.conf`.\n")
  1283.       ::ask-ip-need 0
  1284.       ::ask-ip-default ""
  1285.       name-server-addr (ask-ip-address))
  1286.    (set name-server-list (cat name-server-list
  1287.                   "NAMESERVER " name-server-addr "\n")
  1288.     name-server-text-list (cat name-server-text-list "\n"
  1289.                    name-server-addr))))
  1290.  
  1291. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1292. ;;
  1293. (procedure
  1294.  ask-domains
  1295.  ;;
  1296.  (set domain-list ""
  1297.       text-domain-list "")
  1298.  (while
  1299.      (set domain
  1300.       (askstring
  1301.        (prompt
  1302.         "Give domain names (one at a time) to search.\n"
  1303.         "Press proceed after you have given each domain.\n"
  1304.         "Give empty domain after you have finished.\n"
  1305.         (if text-domain-list
  1306.         (cat "\nIncluded domains are:"
  1307.             text-domain-list)))
  1308.       (help
  1309.        net-setup-help
  1310.        "    In many environments more than one search domain "
  1311.        "is needed for name resolution.\n"
  1312.        "    For example, most of computers in the Helsinki "
  1313.        "University of Technology are under single domain: "
  1314.        "\"hut.fi\", so the full name of computer named "
  1315.        "\"vipu\" would be \"vipu.hut.fi\". If the default "
  1316.        "domain is \"hut.fi\", then this computer can be "
  1317.        "referred without the domain part of the name (just "
  1318.        "\"vipu\"). However, the computer science department "
  1319.        "has its own domain \"cs.hut.fi\". When computers of "
  1320.            "the computer science department "
  1321.        "are referred, the full name must be supplied, e.g. "
  1322.        "\"colossus.cs.hut.fi\". This can be avoided by "
  1323.        "providing \"cs.hut.fi\" as a secondary search domain. "
  1324.        "The domains are searched in the given order. It is "
  1325.        "fastest to give the most used domain first.\n"
  1326.        "    In Unix systems the domain names are "
  1327.        "usually stored into the file `/etc/resolv.conf`.\n")
  1328.       (default (if domain-list "" my-domain-name))))
  1329.   (set domain-list ("%sDOMAIN %s\n" domain-list domain)
  1330.        text-domain-list (cat text-domain-list "\n" domain)
  1331.        default-domain "")))
  1332.  
  1333. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1334. (procedure
  1335.  create-config-file
  1336.  ;;
  1337.  (textfile (dest (tackon conf-dir "resolv.conf"))
  1338.        (append
  1339.         (if name-server-list (cat "; Name servers\n" name-server-list)))
  1340.        (append
  1341.         (if domain-list (cat "; Domain names\n" domain-list)))))
  1342.  
  1343. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1344. (procedure
  1345.  create-startup-script
  1346.  ;;
  1347.  ;; Create the network startup-script (AmiTCP:bin/startnet)
  1348.  ;;
  1349.  (textfile (dest (tackon bin-dir "startnet"))
  1350.        (append
  1351.         (cat
  1352.                     ;;; Script header
  1353.          ".key IPADDRESS\n"
  1354.          ".bra {\n"
  1355.          ".ket }\n"
  1356.          ".def IPADDRESS " my-host-addr "\n"
  1357.          "\n"
  1358.                     ;;; Log in
  1359.          "; log in\n"
  1360.          "echo\n"
  1361.          "echo login: " default-user-name "\n"
  1362.          (tackon bin-dir "login") " -f " default-user-name "\n"
  1363.          (tackon bin-dir "umask") " 022\n"
  1364.                     ;;; Start AmiTCP
  1365.          "AmiTCP:AmiTCP\n"
  1366.          "WaitForPort AMITCP\n"
  1367.                     ;;; Configure lo0
  1368.          "; Configure loop-back device\n"
  1369.          (tackon bin-dir "ifconfig") " lo0 localhost\n"
  1370.                     ;;; Create interface config file
  1371.          (if if-config-file
  1372.          (cat
  1373.           "; Assure that ENV:Sana2 exists\n"
  1374.           "if not exists ENV:Sana2\n"
  1375.           "  makedir ENV:Sana2\n"
  1376.           "endif\n"
  1377.           "; Create " my-host-if " configuration file\n"
  1378.           "echo \"" if-config "\" >ENV:Sana2/" if-config-file "\n"))
  1379.                     ;;; Configure the network interface
  1380.          "; Configure " my-host-if "\n"
  1381.          (tackon bin-dir "ifconfig") " " my-host-if " {IPADDRESS}"
  1382.          (if dest-host
  1383.          (cat " " dest-host))
  1384.          (if my-host-netmask
  1385.          (cat " netmask " my-host-netmask))
  1386.          "\n"
  1387.                     ;;; Add the host name to the netdb
  1388.          (if my-host-name
  1389.          (cat
  1390.           "; Add IP address entry for this host \n"
  1391.           "rx \"address AMITCP; 'ADD HOST {IPADDRESS} "
  1392.           my-full-name " " my-host-aliases "'\""
  1393.           "\n"))
  1394.                     ;;; Route for this host
  1395.          "; Add route to this host\n"
  1396.          (tackon bin-dir "route") " add {IPADDRESS} localhost\n"
  1397.                     ;;; Route for the default gateway
  1398.          (if def-gateway-addr
  1399.          (cat 
  1400.           "; Add route to the default gateway\n"
  1401.           (tackon bin-dir "route") " add default " def-gateway-addr
  1402.           "\n"))
  1403.                     ;;; Set the ENV:HOSTNAME
  1404.          "setenv HOSTNAME `AmiTCP:bin/hostname`\n"
  1405.                     ;;; Mount TCP: (inet-handler)
  1406.          tcp-mount
  1407.                     ;;; Start inetd?
  1408.          (if (askbool
  1409.           (prompt "\nDo you want the Inetd to be started at the "
  1410.               @app-name " startup?\n")
  1411.           (help "    Inetd is the Internet `Super Server', which "
  1412.             "listens for connections on behalf of other "
  1413.             "servers. When a connection request for a port, "
  1414.             "for which Inetd is configured to listen, arrives "
  1415.             "Inetd accepts the connections and starts the "
  1416.             "server in question.\n"
  1417.             "    The file " (tackon conf-dir "inetd.conf")
  1418.             " contains the configuration information for the "
  1419.             "Inetd, which you will want to edit.\n"
  1420.             "    Refer to the documentation for more "
  1421.             "information."))
  1422.          (cat "; Start the internet `super server'\n"
  1423.               "run AmiTCP:bin/inetd\n")
  1424.            "\n"))))
  1425.  (protect (tackon bin-dir "startnet") "+s +e"))
  1426.  
  1427. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1428. (procedure
  1429.  update-user-startup
  1430.  ;;
  1431.  (set started-at-boot 0
  1432.       to-be-added-to-startup
  1433.       (cat "assign " atcp-assign " " @default-dest "\n"
  1434.        "path " bin-dir " add\n"
  1435.        apipe-mount
  1436.        (if (not is-if-dynamic)
  1437.            (if (askbool
  1438.             (prompt
  1439.              "\nDo you want the " @app-name
  1440.              " to be started at the system startup?")
  1441.             (help
  1442.              "    If you decide not to start the " @app-name " at "
  1443.              "startup, you can later start it by giving command "
  1444.              "\"startnet\" "
  1445.              "at the command shell."))
  1446.            ((set started-at-boot 1)
  1447.             (tackon bin-dir "startnet\n"))))
  1448.        (if (AND
  1449.         (= 2 (exists include-dir))
  1450.         (= 2 (exists lib-dir)))
  1451.            (if (askbool
  1452.             (prompt "\nDo you want to add assigns to "
  1453.                 "netinclude and netlib directories?")
  1454.             (help "    These assigns are only needed for compiling "
  1455.               "programs using the " @app-name "."))
  1456.            (cat "; assigns for programmers\n"
  1457.             "assign netinclude: " include-dir "\n"
  1458.             "assign netlib: " lib-dir "\n"))))
  1459.       complete-to-be-added-to-startup (cat ";BEGIN " @app-name "\n"
  1460.                        to-be-added-to-startup
  1461.                        ";END " @app-name "\n"))
  1462.  ;; Ask for confirmation to add
  1463.  (if (>= exec-version 37)
  1464.      (if
  1465.      (askbool
  1466.       (prompt "\nDo you want Installer to make the required changes to "
  1467.           "your s:user-startup script?\n"
  1468.           "\n(There is a problem with Installer making these "
  1469.           "changes if you do not have the original boot volume "
  1470.           "mounted. Installer may crash or corrupt your system "
  1471.           "in that case.)")
  1472.       (help "If you do not want Installer make the changes, it will "
  1473.         "create a script file containing commands which you should "
  1474.         "add to the s:user-startup file."))
  1475.      ;; Do the addition
  1476.      (startup
  1477.       @app-name
  1478.       (command to-be-added-to-startup)
  1479.       (prompt "Installer will modify your S:User-Startup file. "
  1480.           "Following lines will be appended to it:\n\n"
  1481.           complete-to-be-added-to-startup)
  1482.       (help "   Installer needs to make indicated modifications to "
  1483.         "your user startup file to make sure that everything is "
  1484.         "correctly set up to run the " @app-name ".\n"
  1485.         "   You should make modifications later by hand "
  1486.         "if you skip this part."))
  1487.        ;; Let user add commands
  1488.        ((set addition-to-user-startup
  1489.          (tackon atcp-assign "addition-to-user-startup"))
  1490.     (textfile (dest addition-to-user-startup)
  1491.           (append complete-to-be-added-to-startup))
  1492.     (message "Installer created file " addition-to-user-startup
  1493.          ", which you can add to your startup file by hand. "
  1494.          "The file includes following changes:\n\n"
  1495.          complete-to-be-added-to-startup)))))
  1496.  
  1497. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1498. (procedure
  1499.  ask-copy-old-configuration
  1500.  ;;
  1501.  ;; Copy old configuration files
  1502.  ;; Returns TRUE if AmiTCP does not need to be configured.
  1503.  ;; The reconfiguration is forced if old AmiTCP version is not 4 or higher,
  1504.  ;; since the bin/startnet must be modified.
  1505.  ;;
  1506.  (set
  1507.   edit-change-fingerd "t:edit-change-fingerd"
  1508.   old-conf-dir (tackon old-atcp-directory "db")
  1509.   old-resolv.conf (tackon old-conf-dir "resolv.conf")
  1510.   old-startnet (tackon old-atcp-directory "bin/startnet")
  1511.   old-motd (tackon old-conf-dir "motd"))
  1512.  ;;
  1513.  ;; return version of the old AmiTCP detected
  1514.  ;;
  1515.  (procedure 
  1516.   get-old-atcp-version
  1517.   (if (exists (tackon old-atcp-directory "AmiTCP") (noreq))
  1518.       (/ (getversion (tackon old-atcp-directory "AmiTCP")) 65536)
  1519.     0))
  1520.  ;;
  1521.  (set old-atcp-version (get-old-atcp-version))
  1522.  ;;
  1523.  ;; following is called only if old version is high enough
  1524.  ;;
  1525.  (procedure 
  1526.   copy-myhost-config 
  1527.   (if (AND (exists old-resolv.conf)
  1528.        (exists old-startnet))
  1529.       ((if (>= @user-level 2)
  1530.        (message "\nCopying files\n\n"
  1531.             old-resolv.conf "\n"
  1532.             old-startnet "   \n"
  1533.             "\nto directory \"" @default-dest "\"."))
  1534.        (copyfiles
  1535.     (source old-resolv.conf)
  1536.     (dest conf-dir)
  1537.     (files))
  1538.        (copyfiles
  1539.     (source old-startnet)
  1540.     (dest bin-dir)
  1541.     (files))
  1542.        1                ; succeeded
  1543.        )))
  1544.  ;;
  1545.  (procedure 
  1546.   copy-rest-config
  1547.   (copyfiles
  1548.    (prompt
  1549.     "Select configuration files you want to copy from old configuration")
  1550.    (help
  1551.     "    You may copy your old configuration files or use untouched files "
  1552.     "came with the new distribution.")
  1553.    (source old-conf-dir) 
  1554.    (dest conf-dir)
  1555.    (files)
  1556.    (confirm)
  1557.    (if (AND (exists (tackon old-conf-dir "networks"))
  1558.         (AND (exists (tackon old-conf-dir "ftpdir"))
  1559.          (exists (tackon old-conf-dir "ftpusers"))))
  1560.        (choices                ; release 4.0 or later
  1561.     "AmiTCP.config"
  1562.     "ch_nfstab"
  1563.     "ftpdir"
  1564.     "ftpusers"
  1565.     "group"
  1566.     "inet.access"
  1567.     "inetd.conf"
  1568.     "interfaces"
  1569.     "hosts"
  1570.     "networks"
  1571.     "services"
  1572.     "protocols"
  1573.     "passwd"
  1574.     "rpc")
  1575.      (if (exists (tackon old-conf-dir "inet.access"))
  1576.      (choices            ; release 3.0 beta 2 or later
  1577.       "AmiTCP.config"
  1578.       "ch_nfstab"
  1579.       "group"
  1580.       "inet.access"
  1581.       "inetd.conf"
  1582.       "hosts"
  1583.       "services"
  1584.       "protocols"
  1585.       "passwd"
  1586.       "rpc")
  1587.        (if (exists (tackon old-conf-dir "interfaces"))
  1588.        (choices            ; release 3.0 beta 1 or later
  1589.         "AmiTCP.config"
  1590.         "group"
  1591.         "inetd.conf"
  1592.         "hosts"
  1593.         "services"
  1594.         "protocols"
  1595.         "passwd"
  1596.         "rpc")
  1597.      (if (exists (tackon old-conf-dir "passwd"))
  1598.          (choices            ; release 2.2 or later
  1599.           "AmiTCP.config"
  1600.           "group"
  1601.           "inetd.conf"
  1602.           "hosts"
  1603.           "services"
  1604.           "protocols"
  1605.           "passwd")
  1606.        (choices            ; an old release
  1607.         "AmiTCP.config"
  1608.         "inetd.conf"
  1609.         "hosts"
  1610.         "services"
  1611.         "protocols")))))
  1612.    (optional "nofail" "force" "askuser")))
  1613.  ;;
  1614.  (procedure 
  1615.   copy-motd
  1616.   (if (exists old-motd)
  1617.       ((if (>= @user-level 2)
  1618.        (message "\nCopying file\n\n"
  1619.             old-motd "\n"
  1620.             "(Message Of The Day)\n"
  1621.             "\nto directory \"" conf-dir "\"."))
  1622.        (copyfiles
  1623.     (source old-motd)
  1624.     (dest conf-dir)
  1625.     (files)))))
  1626.  ;;
  1627.  ;; Following is currently not needed, since if old version is too old, we
  1628.  ;; force user to reconfigure AmiTCP anyway
  1629.  ;;
  1630.  (procedure 
  1631.   update-startnet
  1632.   (set startnet-file (tackon bin-dir "startnet"))
  1633.   (if (run (cat "search search \"Mount TCP:\" quiet from " startnet-file)
  1634.        (safe))
  1635.       ((textfile (dest startnet-file)
  1636.          (include startnet-file)
  1637.         (append tcp-mount "\n")
  1638.         (prompt 
  1639.          "\nDo you want to mount TCP: device at network startup?")
  1640.         (help 
  1641.          "    The " @app-name " includes a DOS handler for TCP "
  1642.          "communications. This DOS handler will usually be mounted "
  1643.          "at the network startup.")
  1644.         (confirm))
  1645.        (protect (tackon bin-dir "startnet") "+s +e"))))
  1646.  (procedure
  1647.   update-services
  1648.   (set service-file (tackon conf-dir "services"))
  1649.   (if (run (cat "search search \"amiganetfs\" quiet from " service-file)
  1650.        (safe))
  1651.       (;; Not found, add it 
  1652.        (textfile (dest service-file)
  1653.          (include service-file)
  1654.          (append ";\n; Amiga specific services\n;\n"
  1655.              "amiganetfs      2500/tcp\n")
  1656.          (prompt 
  1657.           "Do you want to add AmigaNetFS service to your "
  1658.           "service database?")
  1659.          (help 
  1660.           "    The " @app-name " includes NetFS, network file system "
  1661.           "between Amigas, by Timo Rossi. It is a TCP based protocol "
  1662.           "which requires both ends of connection have same service "
  1663.           "(TCP port) entries. If you already had NetFS installed "
  1664.           "you probably do not want to update your service "
  1665.           "database.")
  1666.          (confirm)))))
  1667.  (procedure
  1668.   update-hosts
  1669.   (set hosts-file (tackon conf-dir "hosts"))
  1670.   (if (run (cat "search search \"localhost\" quiet from " hosts-file)
  1671.        (safe))
  1672.       (;; Not found, add it
  1673.        (transcript "Adding 'localhost' entry to the db/hosts.")
  1674.        (textfile (dest hosts-file)
  1675.          (include hosts-file)
  1676.          (append ";\n; Entry for the localhost\n;\n"
  1677.              "127.0.0.1 localhost\n")
  1678.          ))))
  1679.  (procedure
  1680.   update-inetd-conf
  1681.   ;; Change fingerd to serv/in.fingerd
  1682.   (set inetd-conf (tackon atcp-assign "db/inetd.conf"))
  1683.   (if (run (cat "search search \"serv/in.fingerd\" quiet from " inetd-conf)
  1684.        (safe))
  1685.       ((textfile 
  1686.     (dest edit-change-fingerd)
  1687.     (append
  1688.      "f b/finger    stream/\n"
  1689.      "e -amitcp:bin/fingerd-amitcp:serv/in.fingerd-\n"
  1690.      "m+"
  1691.      "i"
  1692.      "# NetFS, a networking support between Amigas"
  1693.      "# Remove # from the next line to enable NetFS"
  1694.      "#amiganetfs stream    tcp nowait root amitcp:serv/netfs-server"
  1695.      "Z"
  1696.      "w\n")
  1697.     (safe))
  1698.        (run (cat "c:edit from " inetd-conf " with "
  1699.          edit-change-fingerd " >t:what-changed")
  1700.         (confirm)
  1701.         (prompt "\nUpdate \"inetd.conf\" to use the " @app-name " services?")
  1702.         (help "    The fingerd service daemon is moved to directory "
  1703.           "\"AmiTCP:serv\", and \"inetd.conf\" must be updated to use "
  1704.           "it. Also the NetFS must be added to old configuration")))))
  1705.  ;;
  1706.  (procedure 
  1707.   update-napsaprefs
  1708.   (set old-napsaprefs
  1709.        (if (exists (tackon old-atcp-directory "db/NapsaPrefs") (noreq))
  1710.        (tackon old-atcp-directory "db/NapsaPrefs")
  1711.      (if (exists "s:NapsaPrefs")
  1712.          "s:NapsaPrefs")
  1713.      ""))
  1714.   (if old-napsaprefs
  1715.       (;;
  1716.        (copyfiles 
  1717.     (source old-napsaprefs)
  1718.     (dest conf-dir)
  1719.     (files)
  1720.     (confirm)
  1721.     (prompt "\nUse your old Napsaterm preferences?")
  1722.     (help  "    Installer have found an existing NapsaPrefs file "
  1723.            old-napsaprefs ". You can copy it to new configuration "
  1724.            "directory.")))))
  1725.  (procedure 
  1726.   copy-extra-binaries
  1727.   "")
  1728.  (transcript "Ready to copy old configuration.")
  1729.  (if (askbool
  1730.       (default 1)
  1731.       (prompt
  1732.        "\nDo you want to use settings from an earlier installation?")
  1733.       (help
  1734.        "    Installer have detected existing configuration "
  1735.        "directory \"" old-conf-dir "\" which "
  1736.        "can be used to configure the " app-name ". You can keep most "
  1737.        "of your previous configuration. This is important if you have "
  1738.        "installed extra applications.\n"
  1739.        (if (< old-atcp-version 4)
  1740.        (cat "    However, since the configuration practice of the "
  1741.         @app-name " has changed since your old version, you must "
  1742.         "reconfigure the " @app-name " itself. Sorry for the "
  1743.         "incovenience.\n")
  1744.      (cat "    Installer will copy your \"" old-startnet "\" script and "
  1745.           "\"" old-resolv.conf "\" configuration.\n"))
  1746.        "    Other configuration files will be then "
  1747.        (if (> @user-level 1) 
  1748.        "optionally")
  1749.        " copied.\n"))
  1750.      ((set no-reconfig (if (>= old-atcp-version 4)
  1751.                (copy-myhost-config)))
  1752.       (copy-rest-config)
  1753.       (copy-motd)
  1754.       (update-inetd-conf)
  1755.       (update-hosts)
  1756.       (update-services)
  1757. ;;      (update-startnet)
  1758.       (update-napsaprefs)
  1759.       (copy-extra-binaries)
  1760.       no-reconfig) ;; FALSE if AmiTCP needs to be reconfigured
  1761.    0))
  1762.  
  1763. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1764. (procedure
  1765.  install-emacstcp
  1766.  ;; is GNU Emacs installed?
  1767.  (if (exists "GNUEmacs:" (noreq)) ; check if GNUEmacs is installed
  1768.      (if (exists (tackon source-dir "export/GNUEmacs"))
  1769.      ((transcript "Installing GNUEmacs support files.")
  1770.       (copyfiles
  1771.        (source (tackon source-dir "export/GNUEmacs/lisp"))
  1772.        (prompt "Copying GNU Emacs lisp files to GNUEmacs:lisp")
  1773.        (help "   Emacs lisp files implement the Emacs side of the "
  1774.          "Gnu Emacs TCP support.")
  1775.        (pattern "#?.el#?")
  1776.        (dest "GNUEmacs:lisp")
  1777.        (optional "nofail" "askuser")
  1778.        (confirm))
  1779.       (copyfiles
  1780.        (source (tackon source-dir "export/GNUEmacs/etc"))
  1781.        (choices "tcp_AmiTCP")
  1782.        (prompt "Copying tcp_AmiTCP (program) to GNUEmacs:etc")
  1783.        (help "   tcp_AmiTCP implements the " @app-name " side of the "
  1784.          "Gnu Emacs TCP support.")
  1785.        (dest "GNUEmacs:etc")
  1786.        (optional "nofail" "askuser")
  1787.        (confirm))
  1788.       (if (exists "GNUEmacs:etc/tcp_AmiTCP")
  1789.           (protect "GNUEmacs:etc/tcp_AmiTCP" "+p")) ; tcp is pure
  1790.       ;; Tell user what to do with .emacs
  1791.       (run (cat "run " pager-cmd)
  1792.            (tackon source-dir "export/GNUEmacs/add_to_.emacs")
  1793.            (safe)))
  1794.        (message "GNUEmacs not present in " source-dir "."))
  1795.    (message "GNU Emacs must be installed before....")))
  1796.  
  1797. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1798. (procedure
  1799.  ask-install-emacstcp
  1800.  ;; is GNU Emacs installed?
  1801.  (if (exists "GNUEmacs:" (noreq)) ; check if GNUEmacs is installed
  1802.      (if (exists (tackon source-dir "export/GNUEmacs"))
  1803.      (if (askbool
  1804.           (prompt "\nDo you want to install needed files for GNU Emacs "
  1805.               "support?")
  1806.           (help
  1807.            "    Installer has noticed that you have GNUEmacs: assigned "
  1808.            "in your system. Normally this means that you have the "
  1809.            "GNU Emacs installed.\n"
  1810.            "    AmiTCP/IP provides an Emacs extension, which makes "
  1811.            "it possible to run networking programs with it. To enable "
  1812.            "this feature some files need to be installed "
  1813.            "in to directories under \"GNUEmacs:\".\n"
  1814.            "    If you select \"Yes\", files will be installed and you "
  1815.            "will be able to use TCP/IP applications written for "
  1816.            "GNU Emacs."))
  1817.          (install-emacstcp)
  1818.        (transcript "User denied adding AmiTCP/IP support for GNU Emacs."))
  1819.        (transcript "GNUEmacs not present on " source-dir "."))
  1820.    (transcript "No GNU Emacs detected in system.")))
  1821.  
  1822. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1823. (procedure
  1824.  install-napsaterm
  1825.  ;;
  1826.  ;; Install Napsaterm fonts
  1827.  ;;
  1828.  ;; Ask for directory to install fonts.
  1829.  (procedure
  1830.   ask-napsa-font-dir
  1831.   (askdir
  1832.    (prompt "Select directory where to install Napsaterm fonts.\n")
  1833.    (help "    Here you can specify location where to install "
  1834.      "the Napsaterm font called `napsa'. "
  1835.      "This directory should be in your font path "
  1836.      "(i.e. some directory in the assign fonts:).")
  1837.    (newpath)
  1838.    (default "fonts:")))
  1839.  (if (exists (tackon source-dir "export/Fonts"))
  1840.      (copyfiles
  1841.       (source (tackon source-dir "export/Fonts"))
  1842.       (prompt "Copying font `napsa' to " napsa-font-dir ".")
  1843.       (dest (ask-napsa-font-dir))
  1844.       (optional "nofail")
  1845.       (fonts)
  1846.       (all))
  1847.    (transcript "export/Fonts not present on " source-dir ".")))
  1848.  
  1849. (procedure
  1850.  ask-install-napsaterm
  1851.  ;; Optionally install Napsafonts
  1852.  (if (exists (tackon source-dir "export/Fonts"))
  1853.      (if (askbool
  1854.       (prompt "Do you want to install Napsaterm fonts, napsa?\n"
  1855.           "\n    (Napsaterm uses the special fonts in its window "
  1856.           "if they are installed. "
  1857.           "They are sized 6╫11 pixels and contain some special VT102 "
  1858.           "characters. They are suitable for interlaced screens. "
  1859.           "If you have normal NTSC or PAL screen, it might be better "
  1860.           "to not install Napsa and use Topaz/8.)\n")
  1861.       (help
  1862.        "    Napsaterm is a VT102 terminal emulator which uses the rlogin "
  1863.        "and telnet protocols. You can have a remote login to many hosts "
  1864.        "in Internet with Napsaterm.\n"
  1865.        "    Napsaterm is based on the Niftyterm 1.2 written by "
  1866.        "Todd Williamson and Christopher J. Newman."))
  1867.      (install-napsaterm))
  1868.    (transcript "export/Fonts not present on " source-dir ".")))
  1869.  
  1870. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1871. (procedure
  1872.  ;;
  1873.  ;; Check if user exists in the user database
  1874.  ;;
  1875.  ;; takes the user name in ::user-name
  1876.  ;;
  1877.  does-user-exist
  1878.  (if (run (cat "search " (tackon conf-dir "passwd") " \"" ::user-name "|\" NONUM ")
  1879.       (safe))
  1880.      0
  1881.    1)
  1882.  )
  1883.  
  1884. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1885. (procedure 
  1886.  ;;
  1887.  ;; Add a new user into AmiTCP:db/passwd
  1888.  ;;
  1889.  add-new-user
  1890.  (if (= anu::setdefaults 0)
  1891.      (set   
  1892.       anu::passwd (tackon conf-dir "passwd")
  1893.       anu::passwd-new (cat anu::passwd ".new")
  1894.       anu::passwd-old (cat anu::passwd ".old")
  1895.       anu::tempfile "t:run-the-password"
  1896.       anu::helptext (cat "    You must give an login name, user ID, group ID"
  1897.              "real name and home directory for each user.\n")
  1898.       anu::setdefaults 1
  1899.       anu::username (cat default-user-name)
  1900.       anu::UID 100
  1901.       anu::GID 100
  1902.       anu::realname ""
  1903.       anu::homedir "HOME:"
  1904.       anu::shell "shell"))
  1905.  (while
  1906.      ((set anu::username
  1907.        (askstring
  1908.         (default anu::username)
  1909.         (prompt "Enter the login name of the new user:\n")
  1910.         (help anu::helptext
  1911.           "    The login name consists of lowercase letters a-z "
  1912.           "and numbers.  Its recommended maximum length is 8 "
  1913.           "characters.\n"
  1914.           "    Examples of acceptable login names are `ppessi' "
  1915.           "and `an345'.")))
  1916.       (set ::user-name anu::username)
  1917.       (if (does-user-exist)
  1918.       ((message "User " anu::username " already exists.")
  1919.        1))))
  1920.  (set anu::UID
  1921.       (asknumber
  1922.        (default anu::UID)
  1923.        (prompt (cat "Enter the user ID of the user " anu::username ":\n"))
  1924.        (help anu::helptext
  1925.          "    The user ID is a numeric unique identifier for each "
  1926.          "user. "
  1927.          "It is a number between 100 - 32767 for ordinary users.\n")))
  1928.  (set anu::GID
  1929.       (asknumber
  1930.        (default anu::GID)
  1931.        (prompt (cat "Enter the primary group ID of the user " 
  1932.             anu::username ":\n"))
  1933.        (help anu::helptext
  1934.          "    The group ID is a numeric identifier of groups. "
  1935.          "Each user has a primary group, which is usually 100, "
  1936.          "group \"users\".\n")))
  1937.  (set anu::realname
  1938.       (askstring
  1939.        (default anu::realname)
  1940.        (prompt (cat "Enter the real name of the user " anu::username ":\n"))
  1941.        (help anu::helptext
  1942.          "    The real name can contain any characters except "
  1943.          "comma (`,'), colon (`:') or bar (`|').")))
  1944.  (set anu::homedir
  1945.       (askdir
  1946.        (default anu::homedir)
  1947.        (prompt (cat "Give the home directory of the user " anu::username ":\n"))
  1948.        (help anu::helptext
  1949.          "    When user logs in, the current directory is changed to"
  1950.          "her home directory.  Also, the finger information (.plan"
  1951.          "and .project) is retrieved from home directory.")
  1952.        (newpath)))
  1953.  (set anu::shell
  1954.       (askstring
  1955.        (default anu::shell)
  1956.        (prompt (cat "Enter the name of command interpreter for the user "
  1957.             anu::username ":\n"))
  1958.        (help anu::helptext
  1959.          "    The command interpreter value can be either "
  1960.          "`shell' or `cli'.")))
  1961.  (set anu::passwd-entry 
  1962.       (cat anu::username "||" anu::UID "|" anu::GID "|" 
  1963.        anu::realname "|" anu::homedir "|" anu::shell "\n"))
  1964.  (if (askbool 
  1965.       (prompt (cat "Are you sure you want to add following user:\n\n"
  1966.            "Login name: " anu::username "\n"
  1967.            "User ID: " anu::UID "\n"
  1968.            "Group ID: " anu::GID "\n"
  1969.            "Real name: " anu::realname "\n"
  1970.            "Home directory: " anu::homedir "\n"
  1971.            "Shell: " anu::shell "\n"))
  1972.       (choices (cat "Add " anu::username) (cat "Skip " anu::username))
  1973.       (help "You can still skip creating the new user."))
  1974.      ((textfile (dest anu::passwd-new)
  1975.         (include anu::passwd)
  1976.         (append anu::passwd-entry))
  1977.       (copyfiles (source anu::passwd)
  1978.          (dest conf-dir)
  1979.          (newname "passwd.old")
  1980.          (optional "askuser"))
  1981.       (copyfiles (source anu::passwd-new)
  1982.          (dest conf-dir)
  1983.          (newname "passwd")
  1984.          (optional "askuser"))
  1985.       (textfile (dest anu::tempfile)
  1986.         (append (cat 
  1987.              "failat 5000\n"
  1988.              (tackon bin-dir "login") " " anu::username "\n"
  1989.              (tackon bin-dir "passwd") " " anu::username "\n"
  1990.              "endshell\n"))
  1991.         (safe))
  1992.       (run (cat "newshell from " anu::tempfile))
  1993.       (set anu::username ""
  1994.        anu::UID (+ anu::UID 1)
  1995.        anu::realname "")
  1996.       1))
  1997.  )
  1998.  
  1999. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2000. (procedure
  2001.  ;;
  2002.  ;; Add a new users into AmiTCP:db/passwd
  2003.  ;;
  2004.  add-new-users
  2005.  (while
  2006.      (askbool (prompt "\nDo you want to create a new user account?\n"
  2007.               "\nYou will be logged in with the new account "
  2008.               "immediately to set the password.")
  2009.           (choices "Proceed" "Cancel")
  2010.           (help "    You are about to add a new users into user database. "
  2011.             "Remember that the user id of each user must be unique! "
  2012.             "You will be logged in with the new user account to "
  2013.             "set the password for the new user.\n"))
  2014.    (add-new-user))
  2015.  )
  2016. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2017. (procedure 
  2018.  ;;
  2019.  ;; Ask for the default user
  2020.  ;;
  2021.  ask-default-user
  2022.  (if (= adu::setdefaults 0)
  2023.      (set   
  2024.       adu::setdefaults 1
  2025.       default-user-name ""))
  2026.  (while (= default-user-name "")
  2027.    (while
  2028.        ((set default-user-name
  2029.          (askstring
  2030.           (default default-user-name)
  2031.           (prompt "Enter the default user name\n")
  2032.           (help "    The AmiTCP/IP can handle currently only one user "
  2033.             "at a time.  The default user is selected with `login' "
  2034.             "command by system startup script. ")))
  2035.     (set ::user-name default-user-name)
  2036.     (if (NOT (does-user-exist))
  2037.       (NOT (add-new-user))))))
  2038.  )
  2039.  
  2040. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2041. (procedure
  2042.  ;;
  2043.  ;; Install passwd and group databases
  2044.  ;;
  2045.  install-user-databases
  2046.  (transcript "Installing user databases")
  2047.  (procedure get-mufs-version
  2048.         (set mufs-vernum (getversion "multiuser.library" (resident)))
  2049.         (set mufs-ver (/ mufs-vernum 65536))
  2050.         (set mufs-rev (- mufs-vernum (* ver 65536))))
  2051.  (procedure passwd-create
  2052.         (copyfiles
  2053.          (prompt "Copying " passwd-source " to AmiTCP:db/passwd.")
  2054.          (source passwd-source)
  2055.          (dest conf-dir)
  2056.          (newname "passwd")
  2057.          (optional "nofail")))
  2058.  (procedure group-create
  2059.         (copyfiles
  2060.          (prompt "Copying " group-source " to AmiTCP:db/group.")
  2061.          (source group-source)
  2062.          (dest conf-dir)
  2063.          (newname "group")
  2064.          (optional "nofail")))
  2065. ;
  2066. ; THESE ARE NOT USED AT THE MOMENT
  2067. ;
  2068. ; (procedure 
  2069. ;  ;;
  2070. ;  ;; Change root's password 
  2071. ;  ;;
  2072. ;  change-root-password
  2073. ;  (set iud::script "t:change-root-file")
  2074. ;  (textfile (dest iud::script)
  2075. ;        (append 
  2076. ;         "failat 5000\n"
  2077. ;         "echo Log in as super-user (root):\n"
  2078. ;         (tackon bin-dir "login") " root\n"
  2079. ;         "echo Change the password of root:\n"
  2080. ;         (tackon bin-dir "passwd") "\n"
  2081. ;         "endcli")
  2082. ;        (safe))
  2083. ;  (message "Logging in as `root' and changing the root's password.")
  2084. ;  (run (cat "newshell from " iud::script)
  2085. ;       (safe)))
  2086. ; ;; If we are running multiuser 1.4, do some special
  2087. ; (get-mufs-version)
  2088. ; (if mufs-vernum
  2089. ;     (transcript ("Multiuser.library %ld.%ld found" mufs-ver mufs-rev)))
  2090. ; (if (or (> mufs-ver 39)
  2091. ;     (and (= mufs-ver 39) (>= mufs-rev 151)))
  2092. ;     ((transcript "multiuser.library 1.4 or newer detected")
  2093. ;      (message
  2094. ;       "\n    You seem to have MultiUser 1.4 installed. In order to ensure "
  2095. ;       "the most seamless operation between MultiUser 1.4 and "
  2096. ;       "the " @app-name " you should do following:\n")
  2097. ;      (message
  2098. ;       "\nEither make a link from \"AmiTCP:db/passwd\" to "
  2099. ;       "MultiUser 1.4 \"passwd\" file, for example with command\n\n"
  2100. ;       "makelink AmiTCP:db/passwd :multiuser/config/passwd\n\n"
  2101. ;       "or copy MultiUser 1.4 \"passwd\" file and \"MultiUser.config\" to "
  2102. ;       "directory \"AmiTCP:db/\", then recreate keyfiles with command\n\n"
  2103. ;       "makekeyfiles AmiTCP:db/ AmiTCP:db/ vol1: vol2:    \n")))
  2104.  (set passwd-source
  2105. ;      (if (exists "Inet:db/passwd" (noreq)) ; check for AS225r2 compatible
  2106. ;      "Inet:db/passwd"
  2107.     (tackon source-dir "db/passwd-example"))
  2108. ; )
  2109.  (set group-source (tackon source-dir "db/group-example"))
  2110.  (if (>= @user-level 2)
  2111.      (message 
  2112.       "\n"
  2113.       "Copying user database from file"
  2114.       "\n\n\"" passwd-source "\"\n\n"
  2115.       "and group database from file"
  2116.       "\n\n\"" group-source "\"\n\n"))
  2117.  (passwd-create)
  2118.  (group-create)
  2119. ; (change-root-password)
  2120.  )
  2121.  
  2122. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2123. ;;;
  2124. ;;; Installatation sequence
  2125. ;;;
  2126. (message "Please remember during this installation:\n\n"
  2127.      "    Read the instructions provided behind the \"Help\" "
  2128.      "buttons, if you are not absolutely sure what you are doing.\n"
  2129.      "    Please read the files \"README.FIRST\" and "
  2130.      "\"AmiTCP-demo-40.readme\". They contain "
  2131.      "valuable info you cannot afford to miss. (These files are "
  2132.      "shown automatically at the end of the first time installation.)"
  2133.      )
  2134.  
  2135. (complete 00) (transcript "On making " app-name ".")
  2136. (complete 01) (check-user-level)
  2137. (complete 02) (check-system-version)
  2138. (complete 03) (check-available-memory)
  2139. (complete 04) (check-old-assign)
  2140. (complete 05) (select-destination-directory)
  2141.  
  2142. (if (exists (tackon conf-dir "resolv.conf"))
  2143.     ( ;; Already configured, ask user what s/he wants to do
  2144.      (transcript @app-name " already configured, presenting options")
  2145.      (while
  2146.      ((complete 10)
  2147.       (set choice
  2148.            (askchoice
  2149.         (prompt "The " app-name " seems to be already installed. "
  2150.             "Select one of following:")
  2151.         (help "    Installer has detected that the file "
  2152.               "\"AmiTCP:db/resolv.conf\" exists already. Normally "
  2153.               "this means that the installation has been "
  2154.               "successfully completed.\n"
  2155.               "    You can now select what part of the full "
  2156.               "installation you want to repeat. This selection will "
  2157.               "be repeatedly presented, until \"Done\" is choosed.")
  2158.         (choices "Update Sana-II drivers"        ; 0
  2159.              "Install GNUEmacs support files"    ; 1
  2160.              "Install NapsaTerm fonts"        ; 2
  2161.              "Install user databases"           ; 3
  2162.              "Add new users"                        ; 4
  2163.              "Reconfigure AmiTCP/IP"        ; 5
  2164.              "Done")                ; 6
  2165.         (default 6)))
  2166.       (<> choice 6))
  2167.        (select choice
  2168.            ;; (0)
  2169.            (update-devices)
  2170.            ;; (1)
  2171.            (install-emacstcp)
  2172.            ;; (2)
  2173.            (install-napsaterm)
  2174.            ;; (3)
  2175.            (install-user-databases)
  2176.            ;; (4)
  2177.            (add-new-users)
  2178.            ;; (5)
  2179.            ((transcript "Reconfiguring " @app-name ".")
  2180.         (complete 20) (ask-default-user)
  2181.         (complete 22) (ask-if-dynamic)
  2182.         (complete 25) (ask-hostname)
  2183.         (complete 35) (ask-interfaces)
  2184.         (complete 60) (ask-gateway)
  2185.         (complete 65) (ask-nameservers)
  2186.         (complete 70) (ask-domains)
  2187.         (complete 80) (update-user-startup)
  2188.         (complete 90) (create-startup-script)
  2189.         (complete 95) (create-config-file) ; This must be the last one!
  2190.         ))
  2191.        )
  2192.      )
  2193.   ( 
  2194.    (complete 08) (ask-accept-licence)         ; ask if user accepts the licence
  2195.    (complete 10) (copy-files-to-destination) ; copy AmiTCP/IP files
  2196.    (complete 20) (ask-update-devices)         ; update Sana-II drivers
  2197.    (complete 30) (ask-install-emacstcp)         ; install EmacsTCP
  2198.    (complete 35) (ask-install-napsaterm)     ; install NapsaTerm
  2199.    (if (if (if old-atcp-directory
  2200.            (exists (tackon old-atcp-directory "db/AmiTCP.config") 
  2201.             (noreq)))
  2202.        ((complete 40)
  2203.         (ask-copy-old-configuration)))
  2204.        ((if (exists (tackon conf-dir "passwd"))
  2205.         (transcript "There is already a user database.")
  2206.       ((complete 70)
  2207.        (install-user-databases))) ; install passwd/group
  2208. ;    (complete 80) (ask-default-user)
  2209.     (complete 90) (update-user-startup)
  2210.     )
  2211.      (;; First time installation (or old version is < 4), do it all
  2212.       (if (exists (tackon conf-dir "passwd"))
  2213.       (transcript "There is already a user database.")
  2214.     ((complete 40)
  2215.      (install-user-databases))) ; install passwd/group
  2216.  
  2217.       ;; Configure AmiTCP/IP
  2218.       (complete 45) (ask-default-user)
  2219.       (complete 50) (ask-if-dynamic)
  2220.       (complete 52) (ask-hostname)
  2221.       (complete 60) (ask-interfaces)
  2222.       (complete 75) (ask-gateway)
  2223.       (complete 80) (ask-nameservers)
  2224.       (complete 85) (ask-domains)
  2225.       (complete 90) (update-user-startup)
  2226.       (complete 95) (create-startup-script)
  2227.       (complete 96) (create-config-file)))    ; This must be the last one!
  2228.    ;; show something
  2229.    (run (cat "run " pager-cmd) (tackon atcp-assign "AmiTCP-demo-40.readme") (safe))
  2230.    (run (cat "run " pager-cmd) (tackon atcp-assign "README.FIRST") (safe))
  2231.    )
  2232.   )
  2233. ;;; All done!
  2234. (complete 100)
  2235. (exit "You should reboot your Amiga to make sure that everything is set "
  2236.       "up properly for the " @app-name ". After the reboot, "
  2237.       (if started-at-boot
  2238.       (cat "the " @app-name " should be running. If this is not a case, "))
  2239.       "type \"startnet"
  2240.       (if is-if-dynamic " <current-IP-address>")
  2241.       "\" in a command shell to start the "
  2242.       @app-name ".")
  2243.  
  2244. ; EOF
  2245.