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

	<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>2010-04-04T16:13:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[bensonel]]></name></author>
		<updated>2010-04-04T16:13:48-04:00</updated>

		<published>2010-04-04T16:13:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92682#p92682</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92682#p92682"/>
		<title type="html"><![CDATA[help with ban lookup script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92682#p92682"><![CDATA[
Hi and hello all, new member so please bear with me if i dont correctly express what i am trying to do, i searched through all i could find on the forum and could not find the answer to what i need, so please forgive me if my newness has disbled my search fu.<br><br>What i'm trying to do is when a host/ip joins a channel i want to cross check it with a file of ip address that i have on their seperate lines, like so<br>31.51.16.118<br>23.12.22.192<br>68.126.249.133<br>and if a match is found to the resolved Ip, ban it for 10minutes<br><br>I followed Jamesoff example in his proxycheck script, but when i get to trying to grep the file for a mtach i get stumped, wonder if anyone can explain what i need to do next, or show an example, many thanks<br><br># Blacklist file(s) to look in<br>set black_bbls {<br> "/home/botnick/eggdrop/ip.db"<br>}<br># time in minutes to ban for<br>set black_bantime 10<br><br># add channel flag<br>setudef flag black<br><br># bind events<br>bind join - *!*@* black_join<br><br># cache<br>set black_lastip ""<br><br># catch joins<br>proc black_join { nick host handle channel } {<br><br>#check if channel is active<br>  if {![channel get $channel black]} { return; }<br><br>#get the actual host<br>  regexp ".+@(.+)" $host matches newhost<br>  if [regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} $newhost] {<br><br>#it's a numeric host, skip the lookup<br>    black_check2 $newhost $newhost 1 $nick $newhost $channel<br>  } else {<br>    dnslookup $newhost black_check2 $nick $newhost $channel<br>  }<br>}<br><br># Try to run Blacklist checks)<br>proc black_check2 { ip host status nick orighost channel } {<br>  global black_bbls blacklookup_bbls<br>  if {$status == 1} {<br># And hopefully look it up in the blacklist file(s)<br>    set newip "$ip"<br>    foreach bbl $black_bbls {<br>      dnslookup "$newip" black_check3 $nick $host $channel $bbl<br>    }<br>  } else {<br>    putlog " black: Couldn't resolve $host. (No further action taken.)"<br>  }<br>}<br><br># I'm stumped as how to go from here<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11159">bensonel</a> — Sun Apr 04, 2010 4:13 pm</p><hr />
]]></content>
	</entry>
	</feed>
