Skip to content

Commit

Permalink
[tracking] fix TLE fetch location
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec42 committed Apr 18, 2024
1 parent 95c2289 commit 656f3be
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tracking/update-tracking
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/sh

DATE=`date -Iseconds`
files="iridium-NEXT.txt"
[ ! -z "$1" ] && files="$file iridium.txt tle-new.txt"
files="iridium-NEXT"
[ ! -z "$1" ] && files="$file iridium"

[ ! -z $(dirname $0) ] && cd $(dirname $0)

for f in $files ; do
if [ -f $f ] ; then
mv $f $f.old
if [ -f $f.txt ] ; then
mv $f.txt $f.old
else
touch $f.old
fi
curl -sLO http://celestrak.com/NORAD/elements/$f
if cmp -s $f.old $f ; then
curl -sL -o ${f}.txt "http://celestrak.org/NORAD/elements/gp.php?GROUP=${f}&FORMAT=tle"
if cmp -s $f.old $f.txt ; then
echo "$f is unchanged"
rm $f.old
else
echo "Saving new version of $f"
cp $f tle/${f%.txt}-$DATE.txt
cp $f.txt tle/${f}-$DATE.txt
fi
done

0 comments on commit 656f3be

Please sign in to comment.