/[cvs]/eggdrop1.6/scripts/weed
ViewVC logotype

Annotation of /eggdrop1.6/scripts/weed

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Sun Oct 10 00:56:34 1999 UTC (19 years, 9 months ago) by fabian
Branch: MAIN
Changes since 1.2: +3 -1 lines
yet another tree merge and fixups... let's see how long it takes until I learn this stuff

1 fabian 1.3 #! /bin/sh
2     # ^-- little trick to restart using tclsh \
3     exec tclsh "$0" "$@"
4 segfault 1.1 #
5     # weed out certain undesirables from an eggdrop userlist
6     # try just typing 'tclsh weed' to find out the options
7     # Robey Pointer, november 1994
8     #
9     # <cmwagner@gate.net>:
10     # I did a few bug fixes to the original weed script, things changed...
11     #
12     # when specifying other weed options they would unset the User() field and
13     # a maxlast weed would try and weed again and cause the script to stop due
14     # to User() being already unset (array nonexistant)
15     #
16     # when loadUserFile encountered an xtra field it would try and use the $info
17     # variable, which was supposed to be $xtra (something overlooked when the
18     # line was cut and pasted -- I hate it when that happens)
19     #
20     # changed the formatting of the saved weed file to match more closely to
21     # eggdrop 0.9tp (so this may cause incompatibilities), but when a hostmask
22     # field exactly matched 40 characters it would save it with no spaces after
23     # it and eggdrop would reject the user record. I know I could have easily
24     # changed one character, but I couldn't help myself. <grin>
25     # 5 march 96
26     #
27     # <robey, 23jul96>:
28     # upgrade for v2 userfiles
29     # <bruce s, 4sep96>:
30     # fixed xtra field from getting truncated
31     # <robey, 20sep96>:
32     # stopped it from mangling channel ban lists
33     # <Ec|ipse & dtM, 10jun97>:
34     # upgrade for v3 userfiles
35     # <Ec|ipse 18jun97>:
36     # added an option to remove users from unwanted channels
37     # <Ec|ipse 28oct97>:
38     # upgrade for v4 userfiles, with v3 converter
39     # <Ernst 8mar98>:
40     # fixed bug "list element in braces followed by X instead of space"
41     # (the use of "lrange" where you aren't sure if it's a list is bad)
42     # fixed --CONSOLE item not being included, creating "user" --CONSOLE
43     # <Ernst 1apr98>:
44     # two more improper ocurrences of "lrange" removed
45 fabian 1.2 # <rtc 20sep1999>:
46     # removed ancient way of determining the current time.
47 segfault 1.1 #
48    
49     set exempt {*ban *ignore}
50     set exemptops 0 ; set exemptmasters 0 ; set exemptfriends 0
51     set exemptparty 0 ; set exemptfile 0 ; set exemptchanm 0
52     set exemptbotm 0 ; set exemptchann 0 ; set exemptchanf 0
53     set exemptchano 0
54     set maxlast 0 ; set maxban 0 ; set maxignore 0
55     set weedops 0 ; set weedmasters 0 ; set weednopw 0
56     set stripops 0 ; set stripmasters 0 ; set weedlurkers 0
57     set chanrem {}
58     set convert 0
59    
60 fabian 1.2 set CURRENT [clock seconds]
61 segfault 1.1
62     if {$argc < 1} {
63     puts stdout "\nUsage: weed <userfile> \[options\]"
64     puts stdout " (weeds out users from an eggdrop userlist)"
65     puts stdout "Output goes to <userfile>.weed"
66     puts stdout "Possible options:"
67     puts stdout " -<nick> exempt this user from weeding"
68     puts stdout " ^o ^m ^f exempt ops or masters or friends"
69     puts stdout " ^co ^cm ^cf exempt chanops or chanmasters or chanfriends"
70     puts stdout " ^cn exempt chanowner"
71     puts stdout " ^p ^x exempt party-line or file-area users"
72     puts stdout " ^b exempt botnet master"
73     puts stdout " +<days> weed: haven't been seen in N days"
74     puts stdout " :n weed: haven't EVER been seen"
75     puts stdout " :o :m weed: ops or masters with no password set"
76     puts stdout " :a weed: anyone with no pasword set"
77     puts stdout " o m unop/unmaster: ops or masters with no pass."
78     puts stdout " b<days> weed: bans not used in N days"
79     puts stdout " i<days> weed: ignores created over N days ago"
80     puts stdout " =<chan> weed: channels nolonger supported"
81     puts stdout " c convert v3 eggdrop userfile"
82     puts stdout ""
83     exit
84     }
85     puts stdout "\nWEED 18jun97, robey\n"
86    
87     set filename [lindex $argv 0]
88     for {set i 1} {$i < $argc} {incr i} {
89     set carg [lindex $argv $i]
90     if {$carg == ":n"} {
91     set weedlurkers 1
92     } elseif {$carg == ":o"} {
93     set weedops 1 ; set stripops 0 ; set weednopw 0
94     } elseif {$carg == ":m"} {
95     set weedmasters 1 ; set stripmasters 0 ; set weednopw 0
96     } elseif {$carg == ":a"} {
97     set weednopw 1 ; set weedops 0 ; set weedmasters 0
98     set stripops 0 ; set stripmasters 0
99     } elseif {$carg == "o"} {
100     set stripops 1 ; set weedops 0 ; set weednopw 0
101     } elseif {$carg == "m"} {
102     set stripmasters 1 ; set weedmasters 0 ; set weednopw 0
103     } elseif {$carg == "^m"} {
104     set exemptmasters 1
105     } elseif {$carg == "^o"} {
106     set exemptops 1
107     } elseif {$carg == "^f"} {
108     set exemptfriends 1
109     } elseif {$carg == "^p"} {
110     set exemptparty 1
111     } elseif {$carg == "^x"} {
112     set exemptfile 1
113     } elseif {$carg == "^cf"} {
114     set exemptchanf 1
115     } elseif {$carg == "^cm"} {
116     set exemptchanm 1
117     } elseif {$carg == "^cn"} {
118     set exemptchann 1
119     } elseif {$carg == "^b"} {
120     set exemptbotm 1
121     } elseif {$carg == "^co"} {
122     set exemptchano 1
123     } elseif {$carg == "c"} {
124     set convert 1
125     } elseif {[string index $carg 0] == "-"} {
126     lappend exempt [string range $carg 1 end]
127     } elseif {[string index $carg 0] == "+"} {
128     set maxlast [expr 60*60*24* [string range $carg 1 end]]
129     } elseif {[string index $carg 0] == "b"} {
130     set maxban [expr 60*60*24* [string range $carg 1 end]]
131     } elseif {[string index $carg 0] == "i"} {
132     set maxignore [expr 60*60*24* [string range $carg 1 end]]
133     } elseif {[string index $carg 0] == "="} {
134     lappend chanrem [string tolower [string range $carg 1 end]]
135     } else {
136     puts stderr "UNKNOWN OPTION: '$carg'\n"
137     exit
138     }
139     }
140    
141     if {(!$weedlurkers) && (!$weedops) && (!$weedmasters) && (!$weednopw) &&
142     (!$stripops) && (!$stripmasters) && ($maxlast == 0) && ($convert == 0) &&
143     ($maxban == 0) && ($maxignore == 0) && ($chanrem == {})} {
144     puts stderr "PROBLEM: You didn't specify anything to weed out.\n"
145     exit
146     }
147    
148     set weeding { } ; set strip { } ; set exempting { }
149     if {$weedlurkers} { lappend weeding "lurkers" }
150     if {$weedops} { lappend weeding "pwdless-ops" }
151     if {$weedmasters} { lappend weeding "pwdless-masters" }
152     if {$weednopw} { lappend weeding "pwdless-users" }
153     if {$chanrem != {}} { lappend weeding "unwanted-channel" }
154     if {$maxlast > 0} { lappend weeding ">[expr $maxlast /(60*60*24)]-days" }
155     if {$maxban > 0} { lappend weeding "bans>[expr $maxban /(60*60*24)]-days" }
156     if {$maxignore > 0} { lappend weeding "ign>[expr $maxignore /(60*60*24)]-days" }
157     if {$weeding != { }} { puts stdout "Weeding:$weeding" }
158    
159     if {$stripops} { lappend strip "pwdless-ops" }
160     if {$stripmasters} { lappend strip "pwdless-masters" }
161     if {$strip != { }} { puts stdout "Stripping:$strip" }
162    
163     if {$exemptops} { lappend exempting "(ops)" }
164     if {$exemptmasters} { lappend exempting "(masters)" }
165     if {$exemptfriends} { lappend exempting "(friends)" }
166     if {$exemptparty} { lappend exempting "(party-line)" }
167     if {$exemptfile} { lappend exempting "(file-area)" }
168     if {$exemptchann} { lappend exempting "(channel-owners)" }
169     if {$exemptchanm} { lappend exempting "(channel-masters)" }
170     if {$exemptchano} { lappend exempting "(channel-ops)" }
171     if {$exemptchanf} { lappend exempting "(channel-friends)" }
172     if {$exemptbotm} { lappend exempting "(botnet masters)" }
173     if {[llength $exempt]>2} { lappend exempting "[lrange $exempt 2 end]" }
174     if {$exempting != { }} { puts stdout "Exempt:$exempting" }
175    
176     puts stdout "\nReading $filename ..."
177    
178     proc convertUserFile {fname} {
179     global User Hostmask Channel Botflag LastOn BotAddr Xtra convert
180     puts stdout "\nRunning Converter on $fname"
181     set oldhandle {}
182     if {[catch {set fd [open $fname r]}] != 0} { return 0 }
183     set line [string trim [gets $fd]]
184     if {[string range $line 1 2] == "3v"} {
185     set convert 1
186     } elseif {[string range $line 1 2] == "4v"} {
187     return 0
188     }
189     while {![eof $fd]} {
190     set line [string trim [gets $fd]]
191     if {([string index $line 0] != "#") && ([string length $line] > 0)} {
192     scan $line "%s" handle
193     if {$handle == "-"} {
194     # hostmask
195     set hmList [split [string range $line 2 end] ,]
196     for {set i 0} {$i < [llength $hmList]} {incr i} {
197     lappend Hostmask($oldhandle) [string trim [lindex $hmList $i]]
198     }
199     } elseif {$handle == "!"} {
200     # channel
201     set chList [string trim [string range $line 1 end]]
202     lappend Channel($oldhandle) "[lrange $chList 0 1] [string trim [lindex $chList end] 0123456789]"
203     } elseif {$handle == "*"} {
204     # dccdir
205     set dccdir [string trim [string range $line 2 end]]
206     set User($oldhandle) [lreplace $User($oldhandle) 2 2 $dccdir]
207     } elseif {$handle == "+"} {
208     # email
209     set email [string trim [string range $line 2 end]]
210     set User($oldhandle) [lreplace $User($oldhandle) 3 3 $email]
211     } elseif {$handle == "="} {
212     # comment
213     set comment [string trim [string range $line 2 end]]
214     set User($oldhandle) [lreplace $User($oldhandle) 4 4 $comment]
215     } elseif {$handle == ":"} {
216     # user info line / bot addresses
217     if {[lsearch [split [lindex $User($oldhandle) 0] ""] b] == -1} {
218     set info [string trim [string range $line 1 end]]
219     set User($oldhandle) [lreplace $User($oldhandle) 5 5 $info]
220     } else {
221     set BotAddr($oldhandle) [string trim [string range $line 1 end]]
222     }
223     } elseif {$handle == "."} {
224     # xtra field start
225     if {![info exists xtraList($oldhandle)]} {
226     set xtraList($oldhandle) [string trim [string range $line 1 end]]
227     } {
228     set xtraList($oldhandle) "$xtraList($oldhandle) [string trim [string range $line 1 end]]"
229     }
230     } elseif {$handle == "!!"} {
231     # laston
232     set LastOn($oldhandle) [lindex $line 1]
233     } else {
234     # finish up xtra field first
235     if {[info exists xtraList($oldhandle)]} {
236     for {set i 0} {$i < [llength $xtraList($oldhandle)]} {incr i} {
237     lappend Xtra($oldhandle) [string trim [lindex $xtraList($oldhandle) $i] \{]
238     }
239     }
240     # begin of new user
241     scan $line "%s %s %s %s" handle pass attr ts
242     if {$convert == 1 && $attr != ""} {
243     regsub -all {B} $attr {t} attr
244     set botflags "s h a l r" ; set Botflag($handle) ""
245     set nattr [split [string trim $attr 0123456789] ""] ; set attr ""
246     foreach flag $botflags {
247     if {[lsearch -exact $nattr $flag] != -1} {append Botflag($handle) $flag}
248     }
249     foreach flag $nattr {
250     if {[lsearch -exact $botflags $flag] == -1} {append attr $flag}
251     }
252     }
253     set User($handle) [list $attr $pass {} {} {} {}]
254     set Hostmask($handle) {}
255     set Channel($handle) {}
256     set oldhandle $handle
257     }
258     }
259     }
260     return 1
261     }
262    
263     proc loadUserFile {fname} {
264     global User Hostmask Channel Botflag LastOn BotAddr Xtra
265     set oldhandle {}
266     if {[catch {set fd [open $fname r]}] != 0} { return 0 }
267     set line [string trim [gets $fd]]
268     if {[string range $line 1 2] != "4v"} {
269     if {[string range $line 1 2] == "3v"} {
270     convertUserFile $fname
271     return 1
272     } else {
273     puts stderr "Unknown userfile version! (not v4)\n"
274     exit
275     }
276     }
277     while {![eof $fd]} {
278     set line [string trim [gets $fd]]
279     if {([string index $line 0] != "#") && ([string length $line] > 0)} {
280     scan $line "%s" handle
281     if {$handle == "--HOSTS"} {
282     # hostmask
283     set hmList [lindex $line 1]
284     lappend Hostmask($oldhandle) [string trim $hmList]
285     } elseif {$handle == "-"} {
286     # hostmask
287     set hmList [lindex $line 1]
288     lappend Hostmask($oldhandle) [string trim $hmList]
289     } elseif {$handle == "!"} {
290     # channel
291     set chList [string trim [string range $line 1 end]]
292     lappend Channel($oldhandle) $chList
293     } elseif {$handle == "--BOTADDR"} {
294     # botaddr
295     set BotAddr($oldhandle) [lindex $line 1]
296     } elseif {$handle == "--PASS"} {
297     # pass
298     set pass [string trim [string range $line [expr [string first " " $line] + 1] end]]
299     set User($oldhandle) [lreplace $User($oldhandle) 1 1 $pass]
300     } elseif {$handle == "--DCCDIR"} {
301     # dccdir
302     set first [string first " " $line]
303     if {$first != -1} {
304     set dccdir [string trim [string range $line [expr $first + 1] end]]
305     } {
306     set dccdir ""
307     }
308     set User($oldhandle) [lreplace $User($oldhandle) 2 2 $dccdir]
309     } elseif {$handle == "--COMMENT"} {
310     # comment
311     set first [string first " " $line]
312     if {$first != -1} {
313     set comment [string trim [string range $line [expr $first + 1] end]]
314     } {
315     set comment ""
316     }
317     set User($oldhandle) [lreplace $User($oldhandle) 4 4 $comment]
318     } elseif {$handle == "--INFO"} {
319     # user info line
320     set first [string first " " $line]
321     if {$first != -1} {
322     set info [string trim [string range $line [expr $first + 1] end]]
323     } {
324     set info ""
325     }
326     set User($oldhandle) [lreplace $User($oldhandle) 5 5 $info]
327     } elseif {$handle == "--CONSOLE"} {
328     # console
329     set first [string first " " $line]
330     if {$first != -1} {
331     set console [string trim [string range $line [expr $first + 1] end]]
332     } {
333     set console ""
334     }
335     set User($oldhandle) [lreplace $User($oldhandle) 6 6 $console]
336     } elseif {$handle == "--XTRA"} {
337     # xtra field
338     set first [string first " " $line]
339     if {$first != -1} {
340     set xtraList [string trim [string range $line [expr $first + 1] end]]
341     } {
342     set xtraList ""
343     }
344     lappend Xtra($oldhandle) $xtraList
345     } elseif {$handle == "--LASTON"} {
346     # laston
347     set LastOn($oldhandle) [lindex $line 1]
348     } elseif {$handle == "--BOTFL"} {
349     # botflags
350     set Botflag($oldhandle) [string trim [string range $line 1 end]]
351     } else {
352     # begin of new user
353     scan $line "%s %s %s" handle dash attr
354     set User($handle) [list $attr {} {} {} {} {} {}]
355     set Hostmask($handle) {}
356     set Channel($handle) {}
357     set oldhandle $handle
358     }
359     }
360     }
361     return 1
362     }
363    
364     proc saveUserFile fname {
365     global User Hostmask Channel Botflag LastOn BotAddr Xtra
366     if {[catch {set fd [open $fname w]}] != 0} { return 0 }
367     puts $fd "#4v: weed! now go away."
368     foreach i [array names User] {
369     set hmask "none"
370     set hmloop 0 ; set chloop 0 ; set loloop 0 ; set xloop 0 ; set aloop 0
371     if {[lindex $User($i) 1] == "bans"} {set plug "bans"} {set plug "-"}
372     set attr [lindex $User($i) 0]
373     set ts [lindex $User($i) 2]
374     puts $fd [format "%-9s %-20s %-24s" $i $plug $attr]
375     for {} {$hmloop < [llength $Hostmask($i)]} {incr hmloop} {
376     if {[string index $i 0] == "*" || [string range $i 0 1] == "::"} {
377     set hmask [lindex $Hostmask($i) $hmloop]
378     regsub -all {~} $hmask { } hmask
379     puts $fd "- $hmask"
380     } else {
381     puts $fd "--HOSTS [lindex $Hostmask($i) $hmloop]"
382     }
383     }
384     if {[info exists BotAddr($i)]} {
385     puts $fd "--BOTADDR [lindex $BotAddr($i) 0]"
386     }
387     if {[info exists Xtra($i)]} {
388     for {} {$xloop < [llength $Xtra($i)]} {incr xloop} {
389     puts $fd "--XTRA [lindex $Xtra($i) $xloop]"
390     }
391     }
392     if {[info exists Channel($i)]} {
393     for {} {$chloop < [llength $Channel($i)]} {incr chloop} {
394     puts $fd "! [lindex $Channel($i) $chloop]"
395     }
396     }
397     if {[info exists Botflag($i)]} {
398     if {$Botflag($i) != ""} { puts $fd "--BOTFL [lindex $Botflag($i) 0]" }
399     }
400     if {[string index $i 0] == "*" || [string range $i 0 1] == "::"} {
401     set User($i) [lreplace $User($i) 1 1 {}]
402     }
403     if {[lindex $User($i) 1] != {}} { puts $fd "--PASS [lindex $User($i) 1]" }
404     if {[lindex $User($i) 2] != {}} { puts $fd "--DCCDIR [lindex $User($i) 2]" }
405     if {[lindex $User($i) 3] != {}} { puts $fd "--XTRA EMAIL [lindex $User($i) 3]" }
406     if {[lindex $User($i) 4] != {}} { puts $fd "--COMMENT [lindex $User($i) 4]" }
407     if {[lindex $User($i) 5] != {}} { puts $fd "--INFO [lindex $User($i) 5]" }
408     if {[lindex $User($i) 6] != {}} { puts $fd "--CONSOLE [lindex $User($i) 6]" }
409     if {[info exists LastOn($i)]} {
410     puts $fd "--LASTON [lindex $LastOn($i) 0]"
411     }
412     }
413     close $fd
414     return 1
415     }
416    
417     if {![loadUserFile $filename]} {
418     puts stdout "* Couldn't load userfile!\n"
419     exit
420     }
421    
422     if {$convert == 0} {
423     puts stdout "Loaded. Weeding..."
424     puts stdout "(pwd = no pass, -o/-m = removed op/master, lrk = never seen, exp = expired)"
425     puts stdout "(uwc = unwanted channel)\n"
426     } else {
427     puts stdout "Loaded. Converting..."
428     }
429    
430     set total 0
431     set weeded 0
432     foreach i [array names User] {
433     incr total
434     set attr [lindex $User($i) 0]
435     set chanattr [lindex [lindex $Channel($i) 0] 2]
436     if {([lsearch -exact $exempt $i] == -1) &&
437     ([string range $i 0 1] != "::") &&
438     ([string range $i 0 1] != "--") &&
439     (([string first o $attr] == -1) || (!$exemptops)) &&
440     (([string first m $attr] == -1) || (!$exemptmasters)) &&
441     (([string first f $attr] == -1) || (!$exemptfriends)) &&
442     (([string first p $attr] == -1) || (!$exemptparty)) &&
443     (([string first x $attr] == -1) || (!$exemptfile)) &&
444     (([string first t $attr] == -1) || (!$exemptbotm)) &&
445     (([string first f $chanattr] == -1) || (!$exemptchanf)) &&
446     (([string first m $chanattr] == -1) || (!$exemptchanm)) &&
447     (([string first n $chanattr] == -1) || (!$exemptchann)) &&
448     (([string first o $chanattr] == -1) || (!$exemptchano))} {
449     set pass [lindex $User($i) 1]
450     if {[info exists LastOn($i)]} { set ts [lindex $LastOn($i) 0] } { set ts 0 }
451     if {([string compare $pass "-"] == 0) && ([string first b $attr] == -1)} {
452     if {$weednopw == 1} {
453     unset User($i) ; incr weeded
454     puts -nonewline stdout "[format "pwd: %-10s " $i]"
455     } elseif {([string first o $attr] != -1) && ($weedops == 1)} {
456     unset User($i) ; incr weeded
457     puts -nonewline stdout "[format "pwd: %-10s " $i]"
458     } elseif {([string first m $attr] != -1) && ($weedmasters == 1)} {
459     unset User($i) ; incr weeded
460     puts -nonewline stdout "[format "pwd: %-10s " $i]"
461     }
462     if {([string first o $attr] != -1) && ($stripops == 1)} {
463     set nattr {}
464     for {set x 0} {$x < [string length $attr]} {incr x} {
465     if {[string index $attr $x] != "o"} {
466     set nattr [format "%s%s" $nattr [string index $attr $x]]
467     }
468     }
469     if {$nattr == {}} { set nattr "-" }
470     set User($i) [lreplace $User($i) 0 0 $nattr]
471     puts -nonewline stdout "[format " -o: %-10s " $i]"
472     }
473     if {([string first m $attr] != -1) && ($stripmasters == 1)} {
474     set nattr {}
475     for {set x 0} {$x < [string length $attr]} {incr x} {
476     if {[string index $attr $x] != "m"} {
477     set nattr [format "%s%s" $nattr [string index $attr $x]]
478     }
479     }
480     if {$nattr == {}} { set nattr "-" }
481     set User($i) [lreplace $User($i) 0 0 $nattr]
482     puts -nonewline stdout "[format " -m: %-10s " $i]"
483     }
484     }
485     if {($ts==0) && ($weedlurkers==1) && ([string first b $attr] == -1) && [info exists User($i)]} {
486     unset User($i) ; incr weeded
487     puts -nonewline stdout "[format "lrk: %-10s " $i]"
488     }
489     if {($ts > 0) && ($maxlast > 0) && ($CURRENT-$ts > $maxlast && [info exists User($i)])} {
490     unset User($i) ; incr weeded
491     puts -nonewline stdout "[format "exp: %-10s " $i]"
492     }
493     if {$chanrem != {} && [info exists Channel($i)]} {
494     foreach unchan $chanrem {
495     set id [lsearch [string tolower $Channel($i)] *$unchan*]
496     if {$id != -1} {
497     set Channel($i) [lreplace $Channel($i) $id $id] ; incr weeded
498     puts -nonewline stdout "[format "uwc: %-10s " $i]"
499     }
500     }
501     }
502     }
503     flush stdout
504     }
505     if {$weeded == 0 && $convert == 0} { puts -nonewline stdout "uNF... Nothing to weed!" }
506     puts stdout "\n"
507    
508     foreach i [array names User] {
509     if {([string range $i 0 1] == "::") || ($i == "*ban")} {
510     for {set j 0} {$j < [llength $Hostmask($i)]} {incr j} {
511     set ban [split [lindex $Hostmask($i) $j] :]
512     if {[string range [lindex $ban 2] 0 0] == "+"} {
513     set lastused [lindex $ban 3]
514     if {($maxban > 0) && ($CURRENT-$lastused > $maxban)} {
515     if {$i == "*ban"} {
516     puts stdout "Expired ban: [lindex $ban 0]"
517     } {
518     puts stdout "Expired ban on [string range $i 2 end]: [lindex $ban 0]"
519     }
520     set Hostmask($i) [lreplace $Hostmask($i) $j $j]
521     incr j -1
522     }
523     }
524     }
525     }
526     if {$i == "*ignore"} {
527     for {set j 0} {$j < [llength $Hostmask($i)]} {incr j} {
528     set ign [split [lindex $Hostmask($i) $j] :]
529     set lastused [lindex $ign 3]
530     if {($maxignore > 0) && ($CURRENT-$lastused > $maxignore)} {
531     puts stdout "Expired ignore: [lindex $ign 0]"
532     set Hostmask($i) [lreplace $Hostmask($i) $j $j]
533     incr j -1
534     }
535     }
536     }
537     }
538    
539     puts stdout "\nFinished scan."
540     puts stdout "Original total ($total), new total ([expr $total-$weeded]), zapped ($weeded)"
541    
542     if {![saveUserFile $filename.weed]} {
543     puts stdout "* uNF... Couldn't save new userfile!\n"
544     exit
545     }
546     puts stdout "Wrote $filename.weed"

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23