egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with sendftp tcl

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
xuser
Guest





PostPosted: Sat Jul 17, 2004 8:37 am    Post subject: problem with sendftp tcl Reply with quote

sendftp.tcl
Code:

#
# 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 "/bin/ping -c 1"

# 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 ftd]}]
   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
}





now where can i set user pass etc ...

i put
Code:
sentftp /home/bot/html/index.html www.mynet.com user pas /stats.html


and a timer
Code:
bind time - "* * * * *" time:sendftp
proc time:sendftp {args} {
  sendftp etc.
}


and i get tis error
Code:
Tcl error [time:sendftp]: wrong # args: should be "sendftp localfile server user pass remotefile"



and i dont now what to do
Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber