count up dling waterfalls

master
ml server 2020-01-04 21:47:04 -07:00
parent ed031583ae
commit d8b948817f
1 changed files with 4 additions and 4 deletions

View File

@ -22,12 +22,12 @@ APIURL="https://network.satnogs.org/api"
DOWNDIR="download"
OBSIDMIN="$1"
OBSIDMAX="$2"
OBSID=$OBSIDMAX
OBSID=$OBSIDMIN
cd $DOWNDIR || exit
# Download JSON
while [ $OBSID -gt $OBSIDMIN ]
while [ $OBSID -lt $OBSIDMAX ]
do echo "ID: $OBSID"
mkdir -p $OBSID
cd $OBSID
@ -39,7 +39,7 @@ while [ $OBSID -gt $OBSIDMIN ]
"$APIURL/observations/?id=$OBSID&ground_station=&satellite__norad_cat_id=&transmitter_uuid=&transmitter_mode=&transmitter_type=&vetted_status=&vetted_user=&start=&end=" && sleep `echo $((0 + RANDOM % 6))`
WATERURL=`cat $OBSID.json | jq --compact-output '.[0] | {waterfall}' | cut -f 2- -d : | sed -e 's/}//g' -e 's/http:/https:/g' -e 's/"//g'`
WATERFILE=`basename $WATERURL`
[ ! -f $WATERFILE ] && \
[ ! -f "$WATERFILE" ] && \
curl \
--silent \
--http2 --ipv4 \
@ -48,7 +48,7 @@ while [ $OBSID -gt $OBSIDMIN ]
--output $WATERFILE \
$WATERURL && sleep `echo $((0 + RANDOM % 11))`
cd ..
let OBSID=$OBSID-1
let OBSID=$OBSID+1
done
exit 0