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.

Error creating directory?

Help for those learning Tcl or writing their own scripts.
Post Reply
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Error creating directory?

Post by DJCharlie »

Afternoon all. I'm having a bit of trouble with a small script, and can't find the error I'm getting ANYWHERE else.

The error is:

Code: Select all

[16:16] Tcl error [pub_epage]: event sending error: error creating directory for the contact
The section of the script in question is:

Code: Select all

proc pub_epage {nick uhost hand chan txt} {
   putserv "PRIVMSG #KJSR :Emergency Pager activated! Someone will assist you momentarily."
   putserv "PRIVMSG MemoServ@services.dal.net :SEND DJCharlie You were paged by $nick"
   set pagestatus [exec /usr/local/autodj/eggdrop/scripts/epage.sh]
}
And the shell script (epage.sh) called by the TCL script is:

Code: Select all

#!/bin/bash
echo "You are needed in the Live Chat" | centerim -s msg -p yahoo -t myemailaddress@mydomain.com
talk "can someone come to the live chat please"
echo "Help needed in LiveChat" | mail -s "LiveChat" xxxxxxxxx@txt.att.net
exit
Any ideas?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Try and get the value of ::errorInfo right after triggering the error. You might have to enable the .set or .tcl dcc partyline command (see your configfile for details on this), then type either ".set ::errorInfo" or ".tcl set ::errorInfo" after triggering the error.

My suspicion right now though, is that it's caused by the centerim command in your bash-script, possibly from being executed from your eggdrop directory. Just a guess right now though..
NML_375
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Post by DJCharlie »

nml375 wrote:Try and get the value of ::errorInfo right after triggering the error. You might have to enable the .set or .tcl dcc partyline command (see your configfile for details on this), then type either ".set ::errorInfo" or ".tcl set ::errorInfo" after triggering the error.

My suspicion right now though, is that it's caused by the centerim command in your bash-script, possibly from being executed from your eggdrop directory. Just a guess right now though..
No joy. The errorInfo commands (I tried both) just returned "0" as the response.

Commenting out the centerim command did no good either. Same with cutting out any of the other commands (individually) in the epage.sh script.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Just downloaded and compiled centerim myself. After attempting a similar message (though over icq), I managed to generate the exact same error message. That strengthens my suspisions of centerim. I also get the very same result if I launch it through a bash-shell.

I find it odd that ::errorInfo would be 0, as it should atleast hold the actual error message (+ extra information leading up to the error).

Unfortunately, I'm out of other ideas, the putserv tcl-command will not generate that error under any condition, and as you said you've tried ruling out each line of your bash-script, I frankly don't know where to look further other than re-checking everything over and over..
NML_375
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Post by DJCharlie »

nml375 wrote:Unfortunately, I'm out of other ideas, the putserv tcl-command will not generate that error under any condition, and as you said you've tried ruling out each line of your bash-script, I frankly don't know where to look further other than re-checking everything over and over..
Additionally, I just noticed that the "talk" line in epage.sh isn't being executed... Something screwy is definitely going on with it somewhere, because if I run epage.sh by itself, it executes with no errors.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

There are two differences when a bash-script is started from the command line and using exec within eggdrop;
  • The environment;
    The bash-script will inherit the environment of the parent process, containing such settings as PATH, and similar. This becomes very prominent if you started your eggdrop through a cronjob - as this usually only provides the very most rudimentary environment. Try this from the partyline:

    Code: Select all

    .tcl array get ::env
    This should retrieve the full set of environment variables as seen by your eggdrop. Then compare that from using the "set" command from your bash-shell...
  • Current Working Directory;
    This too is inherited from the parent process. Eggdrop's are usually started from within the directory where it was installed, while you most commonly use your shell directly from the home directory. If centerim cannot differentiate between these, I could very well see it throwing errors such as the earlier mentioned ones..
NML_375
Post Reply