#!/bin/bash

cnt=`ps aux | grep get_latest_MRMS.bash | grep -v grep | wc -l`
echo $cnt
if [ $cnt -lt 3 ]; then
  tmp_date=`date -u +%H%M`
  x=`wget -O junk.html http://mrms.ncep.noaa.gov/data/2D/MergedReflectivityQCComposite/; grep 'grib2.gz' junk.html | tail -1 | awk -F\> '{print $4}' | awk -F\< '{print $1}'`
  rm -f junk.html

  timestr=${x:41:15}
  echo "${timestr} UTC (as of ${tmp_date} UTC)" > /webdata/web/cimss/htdocs/severe_conv/latest_MRMS.txt
fi
