Advertisement
cheako

Kermit fetch of NASA/Horizons data.

Dec 12th, 2011
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. #!/usr/bin/kermit +
  2.  
  3. #
  4. # Kermit fetch of NASA/Horizons data.
  5. #
  6. # Copyright (C) 2011 Mike Mestnik
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License along
  19. # with this program; if not, write to the Free Software Foundation, Inc.,
  20. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21.  
  22. define badversion {
  23. echo Sorry - C-Kermit 7.0 or K95 1.1.19 or later required.
  24. exit 1
  25. }
  26. if not equal "\v(program)" "C-Kermit" badversion
  27. if LLT \v(version) 700196 badversion
  28.  
  29. local kerbang ; Invoked as Kerbang script?
  30. .kerbang = 0 ; Assume no.
  31. if eq "\%0" "\v(cmdfil)" .kerbang = 1 ; This means we were.
  32.  
  33. define ERRQUIT { ; Macro to exit appropriately
  34. if def \%1 echo \%1 ; with an error message.
  35. if \m(kerbang) exit 1 ; If Kerbang script, exit all the way.
  36. stop 1 ; Otherwise return to Kermit prompt.
  37. }
  38.  
  39. set telopt start-tls refuse ; Do not use START_TLS option
  40. set telopt authentication refuse ; Do not use AUTH option
  41. set telopt encrypt refuse refuse ; Do not use ENCRYPT option
  42.  
  43. echo Connecting to Horizons...
  44.  
  45. ; Change the following statement if login on non-Telnet port is desired.
  46.  
  47. SET PRINTER /dev/null
  48. LOG SESSION /dev/null
  49. SET QUIET ON
  50. set input echo off
  51. #TELNET /NOWAIT horizons.jpl.nasa.gov 6775
  52. SET HOST /NOWAIT horizons.jpl.nasa.gov 6775 /telnet
  53. if fail errquit {Can't open Telnet connection to Horizons.}
  54.  
  55. input 20 Horizons
  56. output MSL\10
  57. input 20 ends display
  58. output q
  59. input 20 phemeris
  60. output E\10
  61. input 20 Vectors
  62. output v\10
  63. input 20 center
  64. output c@10\10
  65. input 20 Cylindrical
  66. output c\10
  67. input 20 Specify
  68. output 0,0,0\10
  69. input 20 eclip
  70. output eclip\10
  71. input 20 Starting
  72. output 2011-Dec-13 00:00\10
  73. input 20 Ending
  74. output 2011-Dec-13 00:12\10
  75. input 20 interval
  76. output 1h\10
  77. input 20 Accept
  78. output y\10
  79. input 20 ends display
  80. output q
  81. input 20 ermit
  82. output k\10
  83. input 20 Destination
  84. if not def \%1 assign \%1 "k.log"
  85. output \%1\10
  86. input 20 RECEIVE
  87. receive
  88. # /pipes:on /as-name:/dev/fd/4
  89. input 20 ermit
  90. output q\10
  91. input 20 Pasadena
  92. close connection
  93. q
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement