<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/20474" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2018-06-06T11:14:50-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/20474</id>

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2018-06-06T11:14:50-04:00</updated>

		<published>2018-06-06T11:14:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106875#p106875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106875#p106875"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106875#p106875"><![CDATA[
Then you'll have to modify your bash-script to either disable allocation of a pseudo-terminal, or force it regardless of that your eggdrop does not run on a terminal.<br>A quick search on Google should provide a fair bit of information, as this is not an unusual issue with ssh. <a href="https://stackoverflow.com/questions/7114990/pseudo-terminal-will-not-be-allocated-because-stdin-is-not-a-terminal" class="postlink">https://stackoverflow.com/questions/711 ... a-terminal</a> might be worth a check.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 06, 2018 11:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[l.kleijn]]></name></author>
		<updated>2018-06-06T10:27:36-04:00</updated>

		<published>2018-06-06T10:27:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106874#p106874</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106874#p106874"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106874#p106874"><![CDATA[
yes it's a bash script to autologin by ssh<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12392">l.kleijn</a> — Wed Jun 06, 2018 10:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2018-06-06T10:16:39-04:00</updated>

		<published>2018-06-06T10:16:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106873#p106873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106873#p106873"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106873#p106873"><![CDATA[
I'd believe that error comes from your bash-script...<br>Does it use ssh to connect/execute commands on a remote server?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 06, 2018 10:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[l.kleijn]]></name></author>
		<updated>2018-06-06T10:05:25-04:00</updated>

		<published>2018-06-06T10:05:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106872#p106872</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106872#p106872"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106872#p106872"><![CDATA[
i have now this error<br><div class="codebox"><p>Code: </p><pre><code>&lt;IRCop-Bot&gt; [16:04:15] Tcl error [pub:test]: Pseudo-terminal will not be allocated because stdin is not a terminal.</code></pre></div>How can i fix this ?<br><br>And the script is:<div class="codebox"><p>Code: </p><pre><code>bind pub - ${trigger}test pub:testproc pub:test {nick host hand chan arg} {  global botnick outputchan filename  set invert [exec $filename]  putserv "PRIVMSG $outputchan :Mission Accomplished"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12392">l.kleijn</a> — Wed Jun 06, 2018 10:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[l.kleijn]]></name></author>
		<updated>2018-06-06T08:38:34-04:00</updated>

		<published>2018-06-06T08:38:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106871#p106871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106871#p106871"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106871#p106871"><![CDATA[
Sorry i don't understand it.<br><br>Can you write one for me ? i have a little bit learned about eggdrop but not very much. So it must exec a file from the dir /home/lckleijn called login.<br>The file login is a bash script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12392">l.kleijn</a> — Wed Jun 06, 2018 8:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2018-06-06T06:12:07-04:00</updated>

		<published>2018-06-06T06:12:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106869#p106869</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106869#p106869"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106869#p106869"><![CDATA[
Lets see what we've got here...<br>First off, you invoke the tcl-command "info" with invalid parameters; and to be honest, I'm not sure what you actually intend to do here... For reference, the manpage for the "info" command can be found here: <a href="https://www.tcl.tk/man/tcl/TclCmd/info.htm" class="postlink">https://www.tcl.tk/man/tcl/TclCmd/info.htm</a><br><br>Next, you make a call to "open" with the result from that "info"-command combined with the value of $filename. If you are actually trying to invoke a local executable named "login", passing $filename as the first parameter to it; you'd have to use the pipe-prefix:<div class="codebox"><p>Code: </p><pre><code>set io [open "|./login $filename" r+]</code></pre></div>Unfortunately, you never read nor close $io, and hence you are now leaking file descriptors. Very bad! At a minimum, you should have a "fileevent" for "readable"; making sure to close the file once EOF is reached (process has ended)<div class="codebox"><p>Code: </p><pre><code>proc loginHandler {fileId} {  global outputchan  if {[gets $chan line] &gt;= 0} {    putserv "PRIVMSG $outputchan :$line"  }  if {[eof $chan]} {    close $chan  }}...set io [open "|./login $filename" r+]fconfigure $io -blocking 0 -buffering linefileevent $io read [list loginHandler $io]</code></pre></div>Moving on, you now try to do the very same thing usin exec instead. If "login" is guarantee'd to return immediately, this would probably be safe; however, you've escaped the closing brace, which would result in a parser error. Further, you fail to add a value to the &lt;&lt; operator leading to a syntax error.<br>In it's most simplest form, it'd be done like this:<div class="codebox"><p>Code: </p><pre><code>set invert [exec ./login $filename]</code></pre></div>Keep in mind though, there'd be no point in doing both "open" and "exec"; that would result in your executable being invoked twice. Use the one approach that best suits your needs.<br><br>Next, using the "puts" command would print output to stdout; normally, eggdrops "fork into background", and thus have no access to neither stdin or stdout. Unless you've explicitly started your eggdrop to run in your console, you won't be seeing any output.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 06, 2018 6:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[l.kleijn]]></name></author>
		<updated>2018-06-06T05:29:06-04:00</updated>

		<published>2018-06-06T05:29:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106868#p106868</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106868#p106868"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106868#p106868"><![CDATA[
I want to execute a file named login.<br><br>But i don't no how i can tell the eggdrop to exec him.<br>I tried it in a script but gives an error.<br><div class="codebox"><p>Code: </p><pre><code>proc pub:test {nick host hand chan arg} {  global botnick outputchan filename  set io [open "[info ./login] $filename" r+]  set invert [exec [info ./login] $filename &lt;&lt; \]  puts "Test \n $invert"  putserv "PRIVMSG $outputchan :Mission Accomplished"}</code></pre></div> This is the script<br><br>and the file is existing in the dir /home/lckleijn<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12392">l.kleijn</a> — Wed Jun 06, 2018 5:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2018-06-06T04:57:41-04:00</updated>

		<published>2018-06-06T04:57:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106867#p106867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106867#p106867"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106867#p106867"><![CDATA[
Hello l.kleijn,<br>There's some good reading <a href="https://www.tcl.tk/man/tcl8.5/tutorial/Tcl26.html" class="postlink">here</a> regarding running other processes from tcl-scripts.<br><br>One thing to keep in mind, though, is that eggdrop is a single-threaded process, and using "exec" will prevent your eggdrop from taking any other actions until the child process returns. If the program you are executing is guarantee'd to return immediately, that should not pose a problem. Otherwise, I'd suggest you launch it as a background process (using the &amp; suffix).<br>Using "open" on the other hand does not have these issues, but you'll be tasked with reading/closing the <em class="text-italics">file-handle</em> as the process completes, or you'll run out of resources...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jun 06, 2018 4:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[l.kleijn]]></name></author>
		<updated>2018-06-06T04:20:07-04:00</updated>

		<published>2018-06-06T04:20:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106866#p106866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106866#p106866"/>
		<title type="html"><![CDATA[Console eggdrop]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106866#p106866"><![CDATA[
How is it possible to give an eggdrop a command to execute a file in the shell (console)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12392">l.kleijn</a> — Wed Jun 06, 2018 4:20 am</p><hr />
]]></content>
	</entry>
	</feed>
