#!/bin/bash
FTP_SRV=""
FTP_LOGIN=""
FTP_PW=""
REMOTE_DIR="."
FN=`echo $1 | sed -e s/"\(\\/.*\\/\)"//`
FULLFN_HTM=`echo $1 | sed -e s/"\([.]png\)"/.htm/`
FN_HTM=`echo $FULLFN_HTM | sed -e s/"\(\\/.*\\/\)"//`
SVSS=`echo $1 | sed -e s/"pb[0-9]\+[.]png"/pbsvss.htm/`
ftp -np $FTP_SRV << END_SCRIPT
quote USER $FTP_LOGIN
quote PASS $FTP_PW
binary
cd $REMOTE_DIR
put $1 $FN
put $FULLFN_HTM $FN_HTM
put $SVSS pbsvss.htm
quit
END_SCRIPT