home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckermit.zip / ibm_infoexchange < prev    next >
Text File  |  2003-04-14  |  4KB  |  127 lines

  1. #!/usr/local/bin/kermit +
  2. ;
  3. ; ibm_infoexchange
  4. ;
  5. ; Makes a secure FTP connection to IBM Info Exchange.
  6. ; Requires Kermit 95 1.1.21 or C-Kermit 8.0 or later.
  7. ;
  8. ; Authors: J. Altman, F. da Cruz, Columbia U, June 2002.
  9. ; Most recent update:
  10. ; Mon Feb 24 10:56:44 2003
  11. ;
  12. define \%v 2.08 ; Version of this script
  13. define host ieftpint2.services.ibm.com ; Change this to access another host.
  14.  
  15. ; Unix Usage:
  16. ;   Change the first line to point to the C-Kermit 8.0 executable.
  17. ;   Give this script execute permission.  Then:
  18. ;   ibm_infoexchange [ username [ password ] ]
  19. ;
  20. ; Windows Usage:
  21. ;   k95 ibm_infoexchange  [ username [ password ] ]
  22. ;
  23. ; Or at the Kermit prompt (Windows or Unix):
  24. ;   take ibm_infoexchange  [ username [ password ] ]
  25. ;
  26. ; Include your IBM IE username as the first command-line argument to 
  27. ; this script.  If the username is not given, the script prompts you for it.
  28. ;
  29. ; If you wish, you may also include your IBM IE password as the second
  30. ; command-line argument.  If no password is given, you are prompted for it.
  31. ;
  32. ; To debug, "define debug 1" before starting the script.
  33. ;
  34. ; The default locations for the certificate and key files are shown below
  35. ; in the script.  If you put them somewhere else, change the script
  36. ; accordingly.  For further details visit:
  37. ;
  38. ;   http://www.columbia.edu/kermit/ibm_ie.html 
  39.  
  40. define badversion echo C-Kermit 8.0 or K95 1.1.21 or later required, exit 1
  41. if LLT \v(version) 800200 badversion
  42. if k-95 set title IBM Information Exchange
  43. if not avail ssl exit 1 "Sorry, SSL not available"
  44.  
  45. if not defined DEBUG define DEBUG 0  ; Change to 1 to debug
  46. if not numeric DEBUG define DEBUG 1
  47.  
  48. echo IBM INFO EXCHANGE ACCESS SCRIPT VERSION \%v
  49.  
  50. if not def \%1 {                     ; If username not given on command line..
  51.     undef \%8                        
  52.     asg \%9 \v(user)                 ; SET LOGIN USER value (if any)
  53.     if def \%9 asg \%8 { [\%9]}      ; Default to show in prompt
  54.     while not def \%1 {
  55.     ask \%1 "IBM Info Exchange User ID\%8: "
  56.     if not def \%1 asg \%1 \%9
  57.     }
  58. }
  59.  
  60. if k-95 { ; Kermit 95
  61.     if exist \v(appdata)certs/ibm_ie_personal.pem {
  62.     set auth ssl rsa-cert-file \v(appdata)certs/ibm_ie_personal.pem
  63.     set auth ssl rsa-key-file \v(appdata)certs/ibm_ie_personal.pem
  64.     } else {
  65.     set auth ssl rsa-cert-file \v(appdata)ibm_ie_personal.pem
  66.     set auth ssl rsa-key-file \v(appdata)ibm_ie_personal.pem
  67.     }
  68.     if < \v(xversion) 2000 set auth ssl verify-file \v(common)ibm_ie_ca.pem
  69. } else {  ; C-Kermit (SAMPLE locations -- your "certs" subdirectory)
  70.     set auth ssl rsa-cert-file \v(home)certs/ibm_ie_personal.pem
  71.     set auth ssl rsa-key-file \v(home)certs/ibm_ie_personal.pem
  72.     set auth ssl verify-file \v(home)certs/ibm_ie_ca.pem
  73. }
  74. set auth ssl verify peer-cert
  75.  
  76. if \m(debug) {
  77.     set auth ssl verbose on
  78.     set auth ssl debug on
  79.     set ftp debug on
  80. } else {
  81.     set auth ssl verbose off
  82.     set auth ssl debug off
  83.     set ftp debug off
  84. }
  85.  
  86. set file collision backup
  87. set file incomplete auto
  88. set file names literal
  89. set receive pathnames off
  90. set send pathnames off
  91. set ftp autologin on
  92. set ftp passive on
  93. set ftp autoauth on
  94. set ftp autoenc on
  95. set ftp credential-forwarding off
  96. set ftp dates on
  97. set ftp filenames literal
  98. set ftp verbose on
  99. set ftp authtype ssl tls 
  100. set ftp server-character-set ascii
  101. set ftp character-set-translation off
  102.  
  103. ; The following is a temporary workaround for a bug in the IBM server,
  104. ; which should be fixed as of 15 January 2003.
  105. ; Note: the Cipher name is case-sensitive.
  106. if > \v(xversion) 1121 set auth tls cipher-list EXP1024-RC4-SHA
  107.  
  108. ; To suppress certificate warnings uncomment the following command:
  109. ; set auth tls certs-ok on
  110.  
  111. ; Avoid SET LOCUS prompt - force DIR, CD, etc, to act at server.
  112. set locus remote
  113.  
  114. ftp open \m(host) ftp /noinit /user:\%1 /password:\%2
  115. if success {
  116.     set ftp command-protection-level private
  117.     set ftp data-protection-level private
  118.     echo
  119.     echo Connected to IBM Info Exchange.
  120.     echo "You may now give FTP client commands like DIR, CD, MGET, etc."
  121.     echo Type "help ftp" for further information.
  122.     echo
  123. } else {
  124.     echo Secure FTP Connection Failed: \v(ftp_message)
  125. }
  126. end
  127.