#!/bin/sh
#!/usr/bin/expect -f

if [ $# -lt 2 ]
then
    echo "Usage : `basename $0` [KIND][FILE]"
    exit
fi

KIND=$1
S_FILE=$2
S_FILE8=$FILE_8

export WORK_DATE=`date +"%Y%m%d"`
#export WORK_DATE=20180101
echo $WORK_DATE
SRC_PATH=/app_data/tcs/FILE/RECV/WORK
JOB_PATH=/app_data/tcs/FILE/RECV
DESC_PATH=/files/app_data/tcs/FILE/RECV
# 남산1호터널(구) ID/PASSWD
NSIP=192.168.201.120
NSUSER=tcs
NSPASS=tcs
NSPORT=22

RECV_F=$S_FILE

#수집서버로 ssh접속하여 shell 실행
#KIND: RFID ISS
sshpass ssh -o StrictHostKeyChecking=no $NSUSER@$NSIP /home/tcs/GREEN_LANE/bin/getServer.sh $KIND $RECV_F

#RFID_CARS_INFO 정보를 CSV로 생성
#cd $JOB_PATH
#iconv -f UTF-8 -t EUC-KR $SRC_PATH/$RECV_F -o $JOB_PATH/$RECV_F
#cp $JOB_PATH/$RECV_F $SRC_PATH/$RECV_F

#생성된 CSV 파일을 수집서버로 송신
/app/tcs/GREEN_LANE/bin/mget.sh $NSIP $NSUSER $NSPASS $DESC_PATH $SRC_PATH $RECV_F $NSPORT


