| 1 | # no ip checker for eggdrop |
|---|
| 2 | # (c) James Seward 2003-6 |
|---|
| 3 | # version 1.1 |
|---|
| 4 | |
|---|
| 5 | # http://www.jamesoff.net/site/projects/eggdrop-scripts/noiphost |
|---|
| 6 | # james@jamesoff.net |
|---|
| 7 | |
|---|
| 8 | # Released under the GPL |
|---|
| 9 | |
|---|
| 10 | ## INSTRUCTIONS |
|---|
| 11 | ############################################################################### |
|---|
| 12 | |
|---|
| 13 | # This script bans users joining your channel with non-resolving hosts. Bans |
|---|
| 14 | # last for a day. (Change the 1440 in the line near the end of the script to |
|---|
| 15 | # change this). |
|---|
| 16 | # |
|---|
| 17 | # Users who are +o, +v, or +f in your bot (local or global) are left alone. |
|---|
| 18 | # |
|---|
| 19 | # Enable the 'noiphosts' flag for channels you want to protect. |
|---|
| 20 | # --> .chanset #somechannel +noiphosts |
|---|
| 21 | # |
|---|
| 22 | # Enable the debug level on the partyline for some debug output |
|---|
| 23 | # --> .console +d (to enable) |
|---|
| 24 | # --> .console -d (to disable) |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | ## CODE |
|---|
| 28 | ############################################################################### |
|---|
| 29 | |
|---|
| 30 | #bind to joins |
|---|
| 31 | bind join - *!*@* bancheck_join |
|---|
| 32 | |
|---|
| 33 | #add our channel flag |
|---|
| 34 | setudef flag noiphosts |
|---|
| 35 | |
|---|
| 36 | #it all happens in here |
|---|
| 37 | proc bancheck_join { nick host handle channel } { |
|---|
| 38 | #check we're active |
|---|
| 39 | if {![channel get $channel noiphosts]} { |
|---|
| 40 | return 0 |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | putloglev d * "noiphosts: join by $host to $channel" |
|---|
| 44 | |
|---|
| 45 | #don't apply to friends, voices, ops |
|---|
| 46 | if {[matchattr $handle +fov|+fov $channel]} { |
|---|
| 47 | putloglev d * "noiphosts: $nick is a friend" |
|---|
| 48 | return 0 |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | #check host |
|---|
| 52 | if [regexp {@([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})$} $host matches ip] { |
|---|
| 53 | putlog "noiphosts: $nick has an un-resolved host ($ip), banning" |
|---|
| 54 | set banhost "*@$ip" |
|---|
| 55 | newchanban $channel $banhost "noiphosts" "Non-resolving host" 1440 |
|---|
| 56 | } |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | putlog "noiphost 1.1 by JamesOff loaded" |
|---|