#
# Sendftp v1.01 (12/6/97) by Ernst <ernst@studbox.uni-stuttgart.de>
# Ernst's eggdrop page: http://www.sodre.net/ernst/eggdrop/
# =============================================================================
# This is a proc to send a file via FTP to another server. Useful in many
# situations, for example to upload a HTML file generated by eggdrop to your
# www server if it is not the same as your eggdrops machine.
# Change this to something to use to check if a host is alife.
# set pingcheck "" to disable this checking.
# "/bin/ping -c 1" works on Linux. Try just "/bin/ping" on other machines
# Set to "" to disable this checking
set pingcheck ""
# Include it with 'source scripts/sendftp.tcl'. Call it with all parameters:
#
# sendftp <localfile> <server> <user> <password> <remotefile>
#
# 'localfile' and 'remotefile' *must* both be given as FULL paths to the
# filenames, the first on the local, the second on the remote server.
#
# For example:
#
# sendftp /home/bill/stats.htm www.ms.com bill secret /bgates/WWW/stats.htm
# (local-file server user pass remote-file)
proc sendftp { localfile server user pass remotefile } {
global pingcheck
if {![file exist $localfile]} {
return "sendftp: File $localfile does not exist."
}
if {$pingcheck != ""} {
if {[catch {exec [lindex $pingcheck 0] [lrange $pingcheck 1 end] $server > /dev/null 2> /dev/null}]} {
return "sendftp: Machine $server seems to be dead."
}
}
set noftp [catch {set ftpprog [exec which ftp]}]
if {$noftp} {
if {[file executable /usr/bin/ftp]} {
set ftpprog /usr/bin/ftp
set noftp 0
}
if {[file executable /bin/ftp]} {
set ftpprog /bin/ftp
set noftp 0
}
}
if {$noftp} { return "sendftp: You don't seem to have the 'ftp' tool" }
set pipe [open "|$ftpprog -n $server" w]
puts $pipe "user $user $pass"
puts $pipe "bin"
puts $pipe "put $localfile $remotefile"
puts $pipe "quit"
close $pipe
return 1
}
Your problem is with the battle:update procedure.
You should have posted the script with battle:update in it.
The error was quite clear where the problem is:
DragnLord wrote:Your problem is with the battle:update procedure.
You should have posted the script with battle:update in it.
The error was quite clear where the problem is:
Actually, the error is'nt with either tcl's, but with the ftp-binary the sendftp script relies on...
The ftp-binary is unable to create a listening-socket, and thus exits with the error message "ftp: bind: Address already in use".
One way of possibly solving this issue would be to make the client run in passive mode, using proper command with the client. But other than that, your best chance of getting this solved would be to bug your sysadmin.
This would unfortunately be depending on what system and/or ftp client software you've got installed.
Some psuedo-standard approach would be to give the "sendport" command to the client to disable non-passive ("PORT") mode.
You might however wish to look into your system's setup, as users should normally be able to bind to non-system (above 1023) ports on all interfaces. Also, all but very antique ftp software would use random non-system ports for PORT-transfers.
I use the base FTP program. If it would assist you, I can give you a root account on my box temporarily and you can check whether or not that's the problem. I'll also check the sendmode and get back to you.
Giving root-access to someone you don't know in person and really, really trust is a very bad idea.
That said, back to the problem:
Which system do you run, and where applicable, which distribution?
Try executing /usr/bin/ftp, or if command not found, /bin/ftp; connect to remote site, logon with the same credentials that you use with your script, and manually try to send the file. See if you get the same error, and wether using the command "sendport" within the ftp-client helps.
Edit:
Your system does'nt happen to be behind a masquerading firewall (NAT)?
It's behind a firewall, but FTP ports are open. I use a Slackware based distro named Zenwalk. I don't get the error when I manually do it. I have yet to find time to put in sendmode and test it that way.
[21:36:44] <egln|radiobot> Currently: ftp: bind: Address already in use
Looks like there's more than one process using that address.. If it was not able to bind the port for permissions reasons, it would've given a different error msg.
@Nara: Then switching to passive will most certainly solve your issues. This is because your client will send both ip-address and port-number to where the server should connect the datachannel. Unfortunately, your client only knows of its local (or LAN) ip and not the "external" (or WAN), and sends this. Obviously, since the server is'nt located behind your firewall, this really does'nt make much sense to the server, giving a "500 Invalid PORT command" response-code. Your ftp-client then returns a somewhat misleading error message, stating that the address is already in use..
In this case it has nothing to do with any other processes running on your shell