Moved space-track user info to an environment variable

pull/10/head
Cees Bassa 2018-02-24 16:19:07 +01:00
parent 935dda7fc8
commit 3dd3ba2208
1 changed files with 3 additions and 1 deletions

View File

@ -12,11 +12,13 @@ cd $ST_TLEDIR
DATE=`date +%Y%m%d_%H%M%S`
# Get cookie
wget --post-data='identity=username&password=password' --cookies=on --keep-session-cookies --save-cookies=/tmp/cookies.txt 'https://www.space-track.org/ajaxauth/login' -o /tmp/stget.log
wget --post-data=$ST_LOGIN --cookies=on --keep-session-cookies --save-cookies=/tmp/cookies.txt 'https://www.space-track.org/ajaxauth/login' -o /tmp/stget.log
# Get data
wget --keep-session-cookies --load-cookies=/tmp/cookies.txt 'https://www.space-track.org/basicspacedata/query/class/tle_latest/ORDINAL/1/EPOCH/%3Enow-30/format/3le' -O catalog.tle
dos2unix catalog.tle
# Fix missing leading zeros
sed -i -e "s/^1 /1 0000/g" -e "s/^2 /2 0000/g" -e "s/^1 /1 000/g" -e "s/^2 /2 000/g" -e "s/^1 /1 00/g" -e "s/^2 /2 00/g" -e "s/^1 /1 0/g" -e "s/^2 /2 0/g" catalog.tle
cp catalog.tle ${DATE}_catalog.txt
rm login