home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / REFLECT.ZIP / UPLOAD.UNX < prev    next >
Encoding:
Text File  |  1990-01-25  |  8.6 KB  |  225 lines

  1. Q COMMAND ON
  2. DISPLAY "^[H^[J^m"
  3. DISPLAY "Uploading the UNIX host file transfer program:^m^j^j"
  4. DISPLAY "The upload process is controlled by a command file which you are^m^j"
  5. DISPLAY "currently executing.   It is  designed to do two things;  upload^m^j"
  6. DISPLAY "the host file transfer program,  and configure  REFLECTION  for^m^j"
  7. DISPLAY "subsequent file transfers to and from a UNIX host. The host file^m^j"
  8. DISPLAY "transfer program, called  unixlink.c, must reside on the current^m^j"
  9. DISPLAY "drive  of your computer.  It  should  only  need to  be uploaded^m^j"
  10. DISPLAY "to the host once;   the following procedure is used by this com-^m^j"
  11. DISPLAY "mand file to upload unixlink.c.^m^j^j"
  12. DISPLAY "Press Return to continue."
  13. ACCEPT V5
  14. DISPLAY "^[H^[J^m"
  15. DISPLAY "1.  The  following  configuration  parameters  are set  for  the^m^j"
  16. DISPLAY "    upload of unixlink.c:^m^j^j"
  17. DISPLAY "         RECEIVE-PACING : XON/XOFF^m^j"
  18. DISPLAY "         TRANSMIT-PACING: XON/XOFF^m^j"
  19. DISPLAY "         HOST-PROMPT    : NONE^m^j"
  20. DISPLAY "         TABS-TO-SPACES : NO^m^j"
  21. DISPLAY "         SPACES-TO-TABS : NO^m^j"
  22. DISPLAY "         BLOCK-SIZE     : 80^m^j"
  23. DISPLAY "         CHARACTER-DELAY:  1^m^j^j"
  24. DISPLAY "    Also, Inhibit DC1 and Inhibit Handshake are turned on.^m^j^j"
  25. DISPLAY "2.  The sh command is transmitted to the host to change the host^m^j"
  26. DISPLAY "    prompt.  PS1='|'  allows the  command file to  look for this^m^j"
  27. DISPLAY "    prompt from the host at any time during the  upload process.^m^j^j"
  28. DISPLAY "3.  File concatenation  is invoked on the  UNIX system using the^m^j"
  29. DISPLAY "    file name unixlink.c as the destination file.^m^j^j"
  30. DISPLAY "4.  The source file, unixlink.c, is then transmitted to the host^m^j"
  31. DISPLAY "    followed by a control-D to end concatenation.^m^j^j"
  32. DISPLAY "Press Return to continue."
  33. ACCEPT V5
  34. DISPLAY "^[H^[J^m"
  35. DISPLAY "5.  After a pause,  file concatenation is invoked a  second time^m^j"
  36. DISPLAY "    using the name  XXXX.XXX  as the destination file.  The UNIX^m^j"
  37. DISPLAY "    source file is  uploaded a second time  to the host in order^m^j"
  38. DISPLAY "    to check the transfer.^m^j^j"
  39. DISPLAY "6.  CMP is invoked on the host to compare unixlink.c to XXXX.XXX.^m^j"
  40. DISPLAY "    If any  differences exist,  the command file  is terminated.^m^j"
  41. DISPLAY "    At this  point you  should check  configuration  values  for^m^j"
  42. DISPLAY "    possible errors and then try to  upload the program again.^m^j^j"
  43. DISPLAY "7.  If the files are identical,  unixlink.c  is compiled.   Then^m^j"
  44. DISPLAY "    XXXX.XXX is deleted using rm.^m^j^j"
  45. DISPLAY "8.  The  Host  Startup  Sequence  field  on  the  File  Transfer^m^j"
  46. DISPLAY "    Configuration menu is configured for you.  With  unixlink in^m^j"
  47. DISPLAY "    this field,  the correct  host program  is invoked  whenever^m^j"
  48. DISPLAY "    file transfers are done.^m^j^j"
  49. DISPLAY "The entire upload can take up to 12 minutes. You can use  CTRL-Y ^m^j"
  50. DISPLAY "to terminate the upload after it has begun if necessary.^m^j^j"
  51. DISPLAY "Press Y [Return]  to start the upload;  anything else will exit: "
  52. ACCEPT V1
  53. ;goto config
  54. IF UPPER(V1)<>"Y"
  55.   DISPLAY "^m^jCommand file execution terminated without doing anything!^g^m^j"
  56.   Q COMMAND OFF
  57.   STOP
  58. ENDIF
  59. ; turn on inhibit DC1 and inhibit handshake
  60. DISPLAY "^[&s1G"
  61. DISPLAY "^[&s1H"
  62. ;The next five commands are relevant to HP emulation only.
  63. SET RECEIVE-PACING XON/XOFF
  64. SET TRANSMIT-PACING XON/XOFF
  65. SET HOST-PROMPT "^@"
  66. SET SPACES-TO-TABS NO
  67. SET TABS-TO-SPACES NO
  68. SET HOST-STARTUP "unixlink"
  69. SET BLOCK-SIZE 80
  70. SET CHARACTER-DELAY 3
  71. TRANSMIT "^m"
  72. TRANSMIT "sh^m"
  73. WAIT 00:00:2
  74. TRANSMIT "PS1='|' ^m"
  75. WAIT FOR "|"
  76. WAIT FOR "|"
  77. ; set unix kill & erase characters to ctrl-U and ctrl-H, respectively.
  78. TRANSMIT "stty -kill \"\^\U\" ^M"
  79. WAIT 00:00:2
  80. TRANSMIT "stty -erase \"\^\H\" ^M"
  81. WAIT 00:00:2
  82. TRANSMIT "cat > unixlink.c^M"
  83. WAIT 00:00:2
  84. TRANSMIT unixlink.c PAUSE 2
  85. TRANSMIT "^D"
  86. WAIT FOR "|"
  87. TRANSMIT "cat > XXXX.XXX^m"
  88. WAIT 00:00:2
  89. TRANSMIT unixlink.c PAUSE 2
  90. TRANSMIT "^D"
  91. WAIT FOR "|"
  92. TRANSMIT "cmp unixlink.c XXXX.XXX^M"
  93. READHOST V1 UNTIL "|"
  94. IF FIND("DIFFER",UPPER(V1)) > 0
  95.     DISPLAY "Unsuccessful upload.  Check configuration and try again.^m^j^g"
  96.     LET V1 = "Retry"
  97. ;change as of 10/23/86
  98. ELSE
  99.     DISPLAY "Are you using Unix System 5? (Y/N): "
  100.     ACCEPT V1 LIMIT 1
  101.     IF PACK(UPPER(V1))='Y'
  102.       DISPLAY "^M^J PROCESSING - PLEASE WAIT"
  103.       Q DISPLAY ON
  104.       TRANSMIT "if cc -DSYSTEM5 -o unixlink unixlink.c ; then echo 'Successful Upload';^m"
  105.       READHOST V1
  106.       TRANSMIT "else echo 'Unsuccessful Upload - Retry' ; fi^m"
  107.     ELSE
  108.       DISPLAY "^M^J PROCESSING - PLEASE WAIT"
  109.       Q DISPLAY ON
  110.       TRANSMIT "if cc -o unixlink unixlink.c ; then echo 'Successful Upload';^m"
  111.       READHOST V1
  112.       TRANSMIT "else echo 'Unsuccessful Upload - Retry' ; fi^m"
  113.     ENDIF
  114.   READHOST V1
  115.   Q DISPLAY OFF
  116.   READHOST V1 UNTIL "|"
  117. ENDIF
  118. TRANSMIT "rm XXXX.XXX^m"
  119. WAIT FOR "|"
  120. TRANSMIT "^D"
  121. IF FIND("Retry",V1) > 0
  122.     TRANSMIT "^m"
  123.     Q COMMAND OFF
  124.     STOP
  125. ENDIF
  126. WAIT 0:0:2
  127. DISPLAY " ^[H^[J^m^j"
  128. DISPLAY " Now that the host file transfer program  has been  successfully^m^j"
  129. DISPLAY " uploaded, REFLECTION must be configured for file transfers. The^m^j"
  130. DISPLAY " following parameters affect the speed and success of transfers,^m^j"
  131. DISPLAY " they vary  depending on  the  UNIX host  you are  connected to:^m^j^j"
  132. DISPLAY "      BLOCK-SIZE       : can range from 64 to 512.^m^j"
  133. DISPLAY "      SUB-BLOCK-LENGTH : can be from  100 to 240,  or not needed^m^j"
  134. DISPLAY "      CHARACTER-DELAY  : might need to be set to  1,  2, or  3^m^j^j"
  135. DISPLAY " Once you indicate what type of host you are communicating with,^m^j"
  136. DISPLAY " this command file will preset these  parameters to values which^m^j"
  137. DISPLAY " should work under most  conditions.  These values are  saved to^m^j"
  138. DISPLAY " the  default  configuration  file  for later use.  If you  have^m^j"
  139. DISPLAY " trouble  successfully transferring files,  you may need to make^m^j"
  140. DISPLAY " further changes.^m^j^j"
  141. DISPLAY "Press Return to continue"
  142. ACCEPT V5
  143. DISPLAY "^[H^[J^m^j"
  144. :hp
  145. DISPLAY " Is your host an HP9000 (with SYSTEMV HPUX) (Y/N): ? "
  146. ACCEPT V1 LIMIT 1
  147. DISPLAY "^m^j"
  148. IF PACK(UPPER(V1))='Y'
  149.     DISPLAY "^m^j^j"
  150.     DISPLAY "For file transfers to the HP 9000,  the following parameters^m^j"
  151.     DISPLAY "are set^m^j^j"
  152.     DISPLAY "     BLOCK-SIZE       : 256^m^j"
  153.     DISPLAY "     SUB-BLOCK-LENGTH : 0^m^j"
  154.     DISPLAY "     CHARACTER-DELAY  : 0^m^j^j"
  155.     SET BLOCK-SIZE 256
  156.     SET CHARACTER-DELAY 0
  157.     SET SUB-BLOCK-LENGTH 0
  158. ELSE
  159.     IF PACK(UPPER(V1))<>'N'
  160.     DISPLAY "^m^j"
  161.     DISPLAY "You must enter Y or N^m^j"
  162.     goto hp
  163.     ENDIF
  164.     DISPLAY "^m^j"
  165.     DISPLAY "    Is your host a VAX (Berkeley 4.2 or SYSTEM3) (Y/N): ? "
  166.     ACCEPT V2 LIMIT 1
  167.     DISPLAY "^M^J"
  168.     IF PACK(UPPER(V2))='Y'
  169.     DISPLAY "^m^j^j"
  170.     DISPLAY "For file transfers to VAX hosts, the following parameters^m^j"
  171.     DISPLAY "are set:^m^j^j"
  172.     DISPLAY "     BLOCK-SIZE       : 80^m^j"
  173.     DISPLAY "     SUB-BLOCK-LENGTH : 0^m^j"
  174.     DISPLAY "     CHARACTER-DELAY  : 0^m^j"
  175.     SET BLOCK-SIZE 80
  176.     SET SUB-BLOCK-LENGTH 0
  177.     SET CHARACTER-DELAY 0
  178.     ELSE
  179.     IF PACK(UPPER(V2)) <> 'N'
  180.         DISPLAY "^m^j"
  181.         DISPLAY "You must press Y or N^m^j"
  182.         GOTO hp
  183.     ENDIF
  184.     DISPLAY "^m^j^j"
  185.     DISPLAY "If you are not using an HP 9000 or a VAX host, these are^m^j"
  186.     DISPLAY "the  parameters that  are set.  However, you may have to^m^j"
  187.     DISPLAY "experiment if you have trouble.^m^j^j"
  188.     DISPLAY "     BLOCK-SIZE       : 80^m^j"
  189.     DISPLAY "     SUB-BLOCK-LENGTH : 0^m^j"
  190.     DISPLAY "     CHARACTER-DELAY  : 3^m^j^j"
  191.     SET BLOCK-SIZE 80
  192.     SET SUB-BLOCK-LENGTH 0
  193.     SET CHARACTER-DELAY 3
  194.     ENDIF
  195. ENDIF
  196. DISPLAY "^[H^[J^m^j^j"
  197. DISPLAY "If you want to save the configuration values set with this file,^m^j"
  198. DISPLAY "but preserve the default configuration file, enter a unique file^m^j"
  199. DISPLAY "name below, such as UNIX.CFG.  This file can then be loaded when^m^j"
  200. DISPLAY "you want to transfer files to UNIX systems.^m^j^j"
  201. DISPLAY "Press Return to save to the current  default  configuration file^m^j"
  202. DISPLAY "or enter a file name: "
  203. ACCEPT V1
  204. IF PACK(UPPER(V1))=''
  205.    SAVE
  206.    CONTINUE
  207.    LET V2 = MID($SERIAL,3,3)
  208.    IF ERROR
  209.       DISPLAY "Configuration Saved"
  210.       GOTO end
  211.    ENDIF
  212.    IF V2 = 0
  213. ; next line is for MAC users only
  214.       DISPLAY "^j^m^jConfiguration Saved to CONFIG^m^j"
  215.    ENDIF
  216.    DISPLAY "^j^m^jConfiguration Saved to R$2.CFG^m^j"
  217. ELSE
  218.    SAVE $1 DELETE
  219.    DISPLAY "^j^m^jConfiguration Saved to " & UPPER(V1) & "^m^j"
  220. ENDIF
  221. :end
  222. TRANSMIT "^m"
  223. Q COMMAND OFF
  224. STOP
  225.