######################################## #########################
######################################## #########################
Ftp_download_file ()
{
Echo
Echo begin: Download $1: $2...
Echo
Sleep 0
FTP-I-n <eofdownloadfile
Open $1
User administrator
Bin
Mget $2
Bye
Eofdownloadfile
Echo
Echo end: Download $1: $2...
Echo
Sleep 0
}
Ftp_download_directory ()
{
Echo
Echo begin: Download $1: $2...
Echo
Sleep 0
FTP-I-n <eofdownloaddirectory
Open $1
User administrator
Bin
Mget $2 /*
Bye
Eofdownloaddirectory
Echo
Echo end: Download $1: $2...
Echo
Sleep 0
}
Ftp_upload_file ()
{
Echo
Echo begin: Upload $1: $2...
Echo
Sleep 0
FTP-I-n <eofuploadfile
Open $1
User administrator
Bin
Mput $2
Bye
Eofuploadfile
Echo
Echo end: Upload $1: $2...
Echo
Sleep 0
}
Ftp_upload_directory ()
{
Echo
Echo begin: Upload $1: $2...
Echo
Sleep 0
FTP-I-n <eofuploaddirectory
Open $1
User administrator
Bin
Mput $2 /*
Bye
Eofuploaddirectory
Echo
Echo end: Upload $1: $2...
Echo
Sleep 0
}
Ftp_list_directory ()
{
Echo
Echo begin: list $1: $2...
Echo
Sleep 0
FTP-I-n <eoflistdirectory
Open $1
User administrator
Bin
Ls $2
Bye
Eoflistdirectory
Echo
Echo end: list $1: $2...
Echo
Sleep 0
}
Ls_f_r ()
{
Echo
Echo begin: list $1...
Echo
Sleep 0
Ls-F-r $1
Echo
Echo end: list $1...
Echo
Sleep 0
}
######################################## #########################
#
# Sh: Main
#
# $1:
#
#
######################################## #########################
Echo "****** the name of this program is $0"
Echo "***** the parameters totally passed to this program is $ #"
Echo "****** the parameters are $ *"
Echo
Echo = ***** begin sh...
Echo
Cur_dir = 'pwd'
Remote_ftp_server = "192.168.0.40"
Read-P "Upload (key: U)/download (key: others )? : "Chret
If test u = $ chret
Then
Ls_f_r $ cur_dir
Echo
Echo begin: Upload to remote_pc ========
Echo
Sleep 0
CD $ cur_dir
Ftp_upload_file $ remote_ftp_server $1
Echo
Echo end: Upload to remote_pc ========
Echo
Sleep 0
Ftp_list_directory $ remote_ftp_server/
Else
Ftp_list_directory $ remote_ftp_server/
Echo
Echo begin: Download from remote_pc ========
Echo
Sleep 0
CD $ cur_dir
Ftp_download_file $ remote_ftp_server $1
Echo
Echo end: Download from remote_pc ========
Echo
Sleep 0
Ls_f_r $ cur_dir
Fi
Echo
Echo = ***** end sh...
Echo
Sleep 0
######################################## #########################
######################################## #########################