#!/bin/bash

ip=$1
fileName=$2

ftpUserNameStr=`/usr/bin/mysql -prootaa <<_EOF_
SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPUserName';
_EOF_`

ftpPasswordStr=`/usr/bin/mysql -prootaa <<_EOF_
SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPPassword';
_EOF_`

ftpUserName=`echo $ftpUserNameStr | awk '{print $2}'`
ftpPassword=`echo $ftpPasswordStr | awk '{print $2}'`


ftp -n >>result.txt <<__CTL_END 
open $ip
user $ftpUserName $ftpPassword
bin  
cd /usr/local/wxc2/bin/conf/
put $fileName
bye
__CTL_END

