#!/bin/ksh

MDNAME=tmsmd1
CFGFILE=mds.cfg
BADFILE=

while [ -n "$1" ]
  do
    case $1 in
      -m ) shift; MDNAME=$1;;
      -c ) shift; CFGFILE=$1;;
      *  ) BADFILE=$1;;
    esac
    shift
done

cat << eof | ftp -i -n -v
open $MDNAME
user manager manager
site StartConfiguration $CFGFILE
put $BADFILE $CFGFILE
site StopConfiguration $CFGFILE
close
quit
eof

# echo MD: $MDNAME, right: $CFGFILE, bad: $BADFILE