24.10.2014 Views

Doppler Weather Radar - METNET - India Meteorological Department

Doppler Weather Radar - METNET - India Meteorological Department

Doppler Weather Radar - METNET - India Meteorological Department

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

# Filename: transmet_gif<br />

# Sends files via ftp, syntax:<br />

# sig_ftp SourcePath DestPath DestHost User Password<br />

trap "" HUP<br />

SourcePath=$1<br />

SourceDir=${SourcePath%/*}<br />

SourceFile=${SourcePath##*/}<br />

DestPath=$2<br />

DestDir=${DestPath%/*}<br />

DestFile=${DestPath##*/}<br />

DestHost=$3<br />

# For security, you can always hard code in the username and/or<br />

# password here.<br />

User=$4<br />

Password=$5<br />

# Error checking: Make sure each string has a value.<br />

if [ "${SourceDir}" = "" ]; then exit 1; fi<br />

if [ "${SourceFile}" = "" ]; then exit 1; fi<br />

if [ "${DestDir}" = "" ]; then exit 1; fi<br />

if [ "${DestFile}" = "" ]; then exit 1; fi<br />

if [ "${DestHost}" = "" ]; then exit 1; fi<br />

if [ "${User}" = "" ]; then exit 1; fi<br />

if [ "${Password}" = "" ]; then exit 1; fi<br />

cd $SourceDir<br />

INTYPE=`echo $DestFile|cut -c1-3`<br />

INPPITYPE=`echo $DestFile|cut -c1-5`<br />

INHOUR=`echo $DestFile|cut -c24-25`<br />

OUTTYPE=${INTYPE}<br />

if [ "${INPPITYPE}" = "PPI_Z" ]; then OUTTYPE="ppz"; fi<br />

if [ "${INPPITYPE}" = "PPI_V" ]; then OUTTYPE="ppv"; fi<br />

if [ "${INTYPE}" = "MAX" ]; then OUTTYPE="caz"; fi<br />

if [ "${INTYPE}" = "VVP" ]; then OUTTYPE="vp2"; fi<br />

if [ "${INTYPE}" = "SRI" ]; then OUTTYPE="sri"; fi<br />

if [ "${INTYPE}" = "RNN" ]; then OUTTYPE="pac"; fi<br />

if [ "${INTYPE}" = "SHE" ]; then OUTTYPE="3Dshear"; fi<br />

if [ "${INTYPE}" = "VIL" ]; then OUTTYPE="vil"; fi<br />

if [ "${INTYPE}" = "WRN" ]; then OUTTYPE="duststormwarning";<br />

if [ "${INTYPE}" = "RNN" -a "${INHOUR}" != "03" ]; then exit $?;<br />

OUTNAME=${OUTTYPE}"_dlh.gif"<br />

scp $SourceFile "internet:/home/operator/LatestImages/"$OUTNAME<br />

# For debugging, consider adding the -v option, and running<br />

# manually from a shell.<br />

ftp -n -g -v

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!