#!/bin/sh
#
# fetch:
#
# Copyright (c) 2002 James McKenzie <james@fishsoup.dhs.org>,
# All rights reserved.
#
# $Id:$
#
# $Log:$
#

NV=-nv
ENN=-N
SKIPRM=true

mkdir -p NOBACKUP

H=..

if [ ! -f next ]; then
  touch -t 200001010101.00 next
fi

touch now

if [ now -nt next ]; then

  ( cd NOBACKUP

#    export http_proxy=http://10.32.76.1:81/

#   wget ${NV} ${ENN} http://www.ssec.wisc.edu/data/comp/latest_moll.gif
#   ln -sf latest_moll.gif ir.gif

#   wget ${NV} ${ENN} http://www.ssec.wisc.edu/data/comp/wv/LATEST_WV.gif
#   ln -sf LATEST_WV.gif vw.gif

    $SKIPRM || /bin/rm -f latest_sst.gif
    wget ${NV} ${ENN} http://www.ssec.wisc.edu/data/sst/latest_sst.gif
    ln -sf latest_sst.gif ss.gif

    for i in AI EI WI JI XI; do
      mkdir -p $i
      ( cd $i
    	$SKIPRM || /bin/rm -f latest_n.jpg
        wget ${NV} ${ENN} http://www.sat.dundee.ac.uk/pdus/$i/latest_n.jpg
      )
      ln -sf $i/latest_n.jpg $i.jpg
    done

  )
  
  touch next -t `date -d 'now+1hours' '+%Y%m%d%H%M.%S'`

fi



