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 

ftp-send kills script(?) [solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Sat Jan 20, 2007 11:46 am    Post subject: ftp-send kills script(?) [solved] Reply with quote

Hi,

if I add this:

Code:
[exec /usr/bin/ncftpput -f ./scripts/ftpserver.ftp /Allstars/ ./scripts/moxquizz/quizdata/rankallstars.data]


to my MoxQuiz-Script (or any other script) the script stops. It does send the rankallstars.data though.

Same thing with this timer-command:

Code:
bind time - "10 * * * *"


It only sends once. 10 min. later nothing happens.

If i bind it to a "!send"-command it works.



Thx for your help,

-typ-


Last edited by cannot_delete on Sun Jan 28, 2007 8:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Mon Jan 22, 2007 4:06 pm    Post subject: Reply with quote

Pls, anyone help me. =)

It doesn't need to be this code. I just need something that sends this file every 24h by ftp.

Thx,

-typ-
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Jan 22, 2007 8:21 pm    Post subject: Reply with quote

It would stop because you're not logging into a user account and sending a pass?

It's possible this post is what you need to read; do it via a bash script (with crontab) instead.

The code in the last post will require a little editing to have it do what you want but I think you'll get the idea of how it is supposed to work.

There's also sendftp.tcl.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Tue Jan 23, 2007 10:06 am    Post subject: Reply with quote

Hi,

thx for your help. I#m not sure if I understood your first question right. But my user-account data and pass are saved in the "ftpserver.ftp" mentioned here:

[exec /usr/bin/ncftpput -f ./scripts/ftpserver.ftp /Allstars/ ./scripts/moxquizz/quizdata/rankallstars.data]

The bot executes this line (successfully send the rankallstars.data to my ftp-account), but stops afterwards. I added another line witch should send another file, but the bot doesn't.

Unfortunally I am not able to use contrab.

Concerning the sendftp.tcl I added:


Code:
set ftpserv "moxquizz/scripts/logzipper.txt moxquiz.mo.funpic.de moxquiz mypass /logs/logzipper.txt"
bind pub - !logs sendftp §ftpserv

set pingcheck ""

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
}


But i get the following error:

Quote:
[15:01] wrong # args: should be "bind type flags cmd/mask ?procname?"
while executing
"bind pub - !logs sendftp §ftpserv"
(file "scripts/mowlgiggle.tcl" line 57)
invoked from within
"source scripts/mowlgiggle.tcl"
(file "eggdrop.conf" line 132)
[15:01] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)


I suppose that means my §ftpserv isn't in the right place. but where to put it?

thx for your help,

-typ-
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jan 23, 2007 10:21 am    Post subject: Reply with quote

Quote:
PUB
bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <channel> <text>

Description: used for commands given on a channel. The first word
becomes the command and everything else is the text argument.
Module: irc

As for freezing after [exec], try use [open "|<command>"] instead (Search the forum for examples).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Jan 23, 2007 12:59 pm    Post subject: Reply with quote

Because bind doesn't work in the way you try to use it, nor does it have the capability to use that character as a variable.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Jan 23, 2007 3:30 pm    Post subject: Reply with quote

@-typ:
As indicated by Sir_Fz's post, the command executed when the binding triggers would be "procname <nick> <user@host> <handle> <channel> <text>", hence you'll have to create your sendftp-proc such that it accepts those arguments accordingly. Also, should you desire to supply additional arguments, you'd have to do it something like this:
Code:
bind pub - !command [list proc $myvar]

Also, you would have to alter your proc accordingly to accept the additional argument, making the argument-list "<myvar> <nick> <user@host> <handle> <channel> <text>".
There is however, much easier ways of doing what I think you wish to accomplish, such as accessing globalspace variables from within your proc (see manpage for "global").
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Wed Jan 24, 2007 7:33 am    Post subject: Reply with quote

Hi,

first: thx for all your help.

I tried implementing the "[open "|<command>"] "-Command because that seemed to be the simplest solution for my problem. Unfortunally I am still searching the forum for an example.

I'll keep you postet.^^


-typ-
Back to top
View user's profile Send private message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Sun Jan 28, 2007 8:02 pm    Post subject: Reply with quote

it worked, thx =)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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