Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/kermit +
- #
- # Kermit fetch of NASA/Horizons data.
- #
- # Copyright (C) 2011 Mike Mestnik
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License along
- # with this program; if not, write to the Free Software Foundation, Inc.,
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- define badversion {
- echo Sorry - C-Kermit 7.0 or K95 1.1.19 or later required.
- exit 1
- }
- if not equal "\v(program)" "C-Kermit" badversion
- if LLT \v(version) 700196 badversion
- local kerbang ; Invoked as Kerbang script?
- .kerbang = 0 ; Assume no.
- if eq "\%0" "\v(cmdfil)" .kerbang = 1 ; This means we were.
- define ERRQUIT { ; Macro to exit appropriately
- if def \%1 echo \%1 ; with an error message.
- if \m(kerbang) exit 1 ; If Kerbang script, exit all the way.
- stop 1 ; Otherwise return to Kermit prompt.
- }
- set telopt start-tls refuse ; Do not use START_TLS option
- set telopt authentication refuse ; Do not use AUTH option
- set telopt encrypt refuse refuse ; Do not use ENCRYPT option
- echo Connecting to Horizons...
- ; Change the following statement if login on non-Telnet port is desired.
- SET PRINTER /dev/null
- LOG SESSION /dev/null
- SET QUIET ON
- set input echo off
- #TELNET /NOWAIT horizons.jpl.nasa.gov 6775
- SET HOST /NOWAIT horizons.jpl.nasa.gov 6775 /telnet
- if fail errquit {Can't open Telnet connection to Horizons.}
- input 20 Horizons
- output MSL\10
- input 20 ends display
- output q
- input 20 phemeris
- output E\10
- input 20 Vectors
- output v\10
- input 20 center
- output c@10\10
- input 20 Cylindrical
- output c\10
- input 20 Specify
- output 0,0,0\10
- input 20 eclip
- output eclip\10
- input 20 Starting
- output 2011-Dec-13 00:00\10
- input 20 Ending
- output 2011-Dec-13 00:12\10
- input 20 interval
- output 1h\10
- input 20 Accept
- output y\10
- input 20 ends display
- output q
- input 20 ermit
- output k\10
- input 20 Destination
- if not def \%1 assign \%1 "k.log"
- output \%1\10
- input 20 RECEIVE
- receive
- # /pipes:on /as-name:/dev/fd/4
- input 20 ermit
- output q\10
- input 20 Pasadena
- close connection
- q
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement