From 4861ee35cf9c99588bf47644d48930f400d59b57 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Mon, 12 Jun 2023 00:11:52 +0200 Subject: [PATCH] [tracking] new iridium sats are in iridium-NEXT.txt --- tracking/update-tracking | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tracking/update-tracking b/tracking/update-tracking index 46757f0..40410cf 100755 --- a/tracking/update-tracking +++ b/tracking/update-tracking @@ -1,10 +1,21 @@ -DATE=`date -Iseconds` - -rm iridium.txt -wget http://www.celestrak.com/NORAD/elements/iridium.txt -cp iridium.txt tle/iridium-$DATE.txt +#!/bin/sh -rm iridium-NEXT.txt -wget http://www.celestrak.com/NORAD/elements/iridium-NEXT.txt -cp iridium-NEXT.txt tle/iridium-NEXT-$DATE.txt +DATE=`date -Iseconds` +files="iridium-NEXT.txt" +[ ! -z "$1" ] && files="$file iridium.txt tle-new.txt" +for f in $files ; do + if [ -f $f ] ; then + mv $f $f.old + else + touch $f.old + fi + curl -sLO http://celestrak.com/NORAD/elements/$f + if cmp -s $f.old $f ; then + echo "$f is unchanged" + rm $f.old + else + echo "Saving new version of $f" + cp $f tle/${f%.txt}-$DATE.txt + fi +done