<?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/15834" />

	<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>2008-06-17T07:39:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2008-06-17T07:39:01-04:00</updated>

		<published>2008-06-17T07:39:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83584#p83584</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83584#p83584"/>
		<title type="html"><![CDATA[wget and dccsend trouble]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83584#p83584"><![CDATA[
Yes, because you are not using the -b flag with wget, which you could have done with exec as well.  However, you will most likely get incomplete dccsends, especially if the download host is slower than the bot's dcc transfer, since you are not waiting for the download to finish before sending.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Jun 17, 2008 7:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2008-06-17T06:17:07-04:00</updated>

		<published>2008-06-17T06:17:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83583#p83583</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83583#p83583"/>
		<title type="html"><![CDATA[wget and dccsend trouble]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83583#p83583"><![CDATA[
It seems to me this code works fine: <div class="codebox"><p>Code: </p><pre><code>if {[string match {*-get*} $ustr]} {set fp [open "| /usr/bin/wget -P /home/bots/mybot/scripts/files/$unick/ $wwwlink"]if {[catch {close $fp} err]} {regexp -all -nocase -- {httpcode(.*?)here} $wwwlink - filenamedccsend /home/bots/mybot/scripts/files/$unick/$filename $unickreturn}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Tue Jun 17, 2008 6:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2008-06-15T15:41:36-04:00</updated>

		<published>2008-06-15T15:41:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83545#p83545</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83545#p83545"/>
		<title type="html"><![CDATA[wget and dccsend trouble]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83545#p83545"><![CDATA[
Now you are using -b with wget to cause wget to return right away, meaning the script will continue on immediately WHILE wget downloads the file.  You will need to remove the -b switch.  Alternatively to exec, you can use open with the |, or use a script that already does this, such as bgexec.tcl which will execute a command in non-blocking mode, and then call a procedure once the command has completed.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sun Jun 15, 2008 3:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2008-06-15T12:40:36-04:00</updated>

		<published>2008-06-15T12:40:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83542#p83542</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83542#p83542"/>
		<title type="html"><![CDATA[wget and dccsend trouble]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83542#p83542"><![CDATA[
Thank you for reply.<br>The next step:<div class="codebox"><p>Code: </p><pre><code>if {[string match {*-get*} $ustr]} {                  set status [catch {exec /usr/bin/wget -b -P /home/bots/mybot/scripts/files/$unick/ $wwwlink} result]                  if {$status == 0} {                  regexp -all -nocase -- {httpcode(.*?)here} $wwwlink - filename                  dccsend /home/bots/mybot/scripts/files/$unick/$filename $unick}</code></pre></div>And I try to replace <div class="codebox"><p>Code: </p><pre><code>dccsend /home/bots/mybot/scripts/files/$unick/$filename $unick</code></pre></div> with this <div class="codebox"><p>Code: </p><pre><code>switch -- [dccsend /home/bots/mybot/scripts/files/$unick/$filename $unick] {    0 {      puthelp "NOTICE $unick :sending $filename to you."      dccsend /home/bots/mybot/scripts/files/$unick/$filename $unick    }    1 { puthelp "NOTICE $unick :dcc table is full (too many connections), try to get $filename later." }    2 { puthelp "NOTICE $unick :can't open a socket for the transfer of $filename." }    3 { puthelp "NOTICE $unick :$filename doesn't exist." }    4 { puthelp "NOTICE $unick :$filename was queued for later transfer." }    }## dcc sends/recieves por Marco Ferra aka nXistence</code></pre></div>and always get "filename doesn't exist."<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Sun Jun 15, 2008 12:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2008-06-14T15:56:20-04:00</updated>

		<published>2008-06-14T15:56:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83528#p83528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83528#p83528"/>
		<title type="html"><![CDATA[wget and dccsend trouble]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83528#p83528"><![CDATA[
For starters, your [exec...] line will most certainly cause an error, and nothing else will be processed after that.<br><br>You only use []'s around a command when you are setting a variable and/or doing something with the results of that command.  Remove the []'s around your exec line.  Secondly, since you are not launching wget into the background, exec will not return control back to the script until wget completes.  This by itself will accomplish what you ask of, however it can also cause your bot to timeout if the download is a long one.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sat Jun 14, 2008 3:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[username]]></name></author>
		<updated>2008-06-14T12:15:57-04:00</updated>

		<published>2008-06-14T12:15:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83525#p83525</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83525#p83525"/>
		<title type="html"><![CDATA[wget and dccsend trouble]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83525#p83525"><![CDATA[
Hello. I`m having some trouble with this part of my code: <div class="codebox"><p>Code: </p><pre><code>if {[string match {*-get*} $ustr]} {                  [exec /usr/bin/wget -P /home/bots/mybot/scripts/files/$unick/ $wwwlink]                  regexp -all -nocase -- {httpcode(.*?)here} $wwwlink - filename                  dccsend /home/bots/mybot/scripts/files/$unick/$filename $unick}</code></pre></div> It works this way: if in my pub cmd bot find word -get he download file from $wwwlink using wget and after that send it to me using dccsend command.<br>But when bot begin dccsend the file from wget didnt already downloaded. <br>How can I scan if wget command is successfully finished and only after that begin dccsend to me?<br>Thank you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6813">username</a> — Sat Jun 14, 2008 12:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
