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 

reading command from an ftp site

 
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
TurboChicken
Halfop


Joined: 29 Sep 2004
Posts: 61

PostPosted: Wed Mar 16, 2005 12:32 pm    Post subject: reading command from an ftp site Reply with quote

need to make a script that will login into an ftp and run a command and return the reply... which i am then going to parse and put into a mysqldb...

i've found this script on the forum and to test i am trying to make it just display the ftp reply in a channel... unfortunately it doesn't seem to be working.

Code:
bind pub -|- !monty ftpcheck
proc ftpcheck {n u h t a} {
  putserv "PRIVMSG #turbo-test :users working"
  set host "ip of site"
  set port "port of site"
  set user "user"
  set pass "pass"
  catch {socket $host $port} sock
  if {[string match -nocase "sock?" $sock]} {
    puts $sock "USER $user"
    puts $sock "PASS $pass"
    puts $sock "site monthdn 3"
    set i 0
    while {![eof $sock]} {
      flush $sock
      gets $sock line
      if {[string match -nocase 200 [lindex $line 0]]} {
        putserv "#Turbo-test $line"
      }
      if $i==100 { close $sock }
      incr i 1
    }
  } else {
    putserv "PRIVMSG #Turbo-test :Error No Route Host."
    return 0
  }
}


the first privmsg to turbo-test works but nothing else
** EDIT ** i get the no route to host reply now so something wrong with the socket syntax?

i've logged into the ftp manually from the shell and it works... the reply to site monthdn 3 looks a lil like this
Code:
200-     __  _______  _   __________  ______  ____ _       ___   __
200-    /  |/  / __ \/ | / /_  __/ / / / __ \/ __ \ |     / / | / /
200-   / /|_/ / / / /  |/ / / / / /_/ / / / / / / / | /| / /  |/ /
200-  / /  / / /_/ / /|  / / / / __  / /_/ / /_/ /| |/ |/ / /|  /
200- /_/  /_/\____/_/ |_/ /_/ /_/ /_/_____/\____/ |__/|__/_/ |_/
200-
200-   ## User         Tagline                  Files   Amount     Speed
200- [ 1] user1        no tagline                6395     242.6GB    - k/s
200- [ 2] user2          no tagline                5908     221.1GB  7.4GB/s
200- [ 3] user3        no tagline                4167     198.8GB    - k/s
200


now i don't understand alot of the code but i understand enough to think that it should work as it is.... any ideas?

regards
Turbo
Back to top
View user's profile Send private message
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