This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

start programs in background

Help for those learning Tcl or writing their own scripts.
Post Reply
K
Koepi
Voice
Posts: 26
Joined: Sun Aug 31, 2003 1:21 am

start programs in background

Post by Koepi »

Hi,

with exec the bot can execute programs. in this time the bot don't react and get sometimes a timeout.
is it possible to execute a program in the background, so that the eggdrop further react?

sorry for my bad english ;)

greets
G
Garp
Voice
Posts: 29
Joined: Mon Sep 15, 2003 7:58 pm

Post by Garp »

I have the same question. I use

Code: Select all

set reply [exec whois.sh $ip]
where whois.sh is a shell script that does a whois lookup and grep for country and ip range. Sometimes the bot doesn't get an answer and waits and waits. Is there a way to execute a shell script and kill the script after a time?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

the bot doesnt support executing to background. you would need to use a "loader" in order to achive real background running, but you probably only need to run a non-blocking child. Use instead:

Code: Select all

set reply [open "|whois.sh $ip" r]
You will most likely want to read up more information about asynrounous file usage including callbacks via fileevent.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
G
Garp
Voice
Posts: 29
Joined: Mon Sep 15, 2003 7:58 pm

Post by Garp »

Vielen Dank Thank you very good inspiration
Post Reply