From 1443285acff706108fe3543fb41384edeb90294e Mon Sep 17 00:00:00 2001 From: Nico Rey Date: Sun, 27 Sep 2020 21:57:34 -0300 Subject: [PATCH] meteor filenames differs from noaa --- migrate_data.sh | 6 +++++- receive.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/migrate_data.sh b/migrate_data.sh index 1202b1c..d7455b3 100644 --- a/migrate_data.sh +++ b/migrate_data.sh @@ -32,7 +32,11 @@ for filename in $(find . -name *.jpg); do date_normalized=$(echo "$basedate" | sed -e "s/^$sat_name//;s/./&:/12;s/./&:/10;s/./& /8;s/./&\//6;s/./&\//4") epoch_date=$(date "+%s" -d "$date_normalized") - passname=$(echo "$basename" | cut -f1,2 -d'-') + if [[ $basename == *"METEOR"* ]]; then + passname=$(echo "$basename" | cut -f1,2,3 -d'-') + else + passname=$(echo "$basename" | cut -f1,2 -d'-') + fi echo "Migration in progress: $basename" cp "$BASEPATH/$filename" "$FINALPATH" convert -thumbnail 300 "$BASEPATH/$filename" "$FINALPATH/thumb/$basename" diff --git a/receive.sh b/receive.sh index b1abb71..f62d842 100755 --- a/receive.sh +++ b/receive.sh @@ -46,7 +46,7 @@ for i in $ENHANCEMENTS; do log "Decoding image" "INFO" /usr/local/bin/wxtoimg -o -m "${NOAA_HOME}/map/${3}-map.png" -e "$i" "${RAMFS_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/image/${3}-$i.jpg" /usr/bin/convert -quality 90 -format jpg "${NOAA_OUTPUT}/image/${3}-$i.jpg" -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE}" "${NOAA_OUTPUT}/image/${3}-$i.jpg" - /usr/bin/convert -thumbnail 300 "${NOAA_OUTPUT}/image/${3}-$i.jpg" "${NOAA_OUTPUT}/image/thumb/${3}-$i.jpg + /usr/bin/convert -thumbnail 300 "${NOAA_OUTPUT}/image/${3}-$i.jpg" "${NOAA_OUTPUT}/image/thumb/${3}-$i.jpg" done if [ -n "$CONSUMER_KEY" ]; then log "Posting to Twitter" "INFO"