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

Diff of /eggdrop1.6/scripts/weed

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

revision 1.2 by fabian, Sat Oct 9 15:46:34 1999 UTC revision 1.6 by guppy, Fri Apr 13 19:19:14 2001 UTC
# Line 1  Line 1 
1  #!/usr/local/bin/tclsh  #! /bin/sh
2    # This trick is borrowed from Tothwolf's Wolfpack \
3    # Search for tclsh[0-9].[0-9] in each valid dir in PATH \
4    for dir in $(echo $PATH | sed 's/:/ /g'); \
5    do \
6      if test -d $dir; \
7      then \
8        files=$(/bin/ls $dir | egrep '^tclsh[0-9]\.[0-9]$'); \
9        if test "$files" != ""; \
10        then \
11          versions="${versions:+$versions }$(echo $files | sed 's/tclsh//g')"; \
12        fi; \
13      fi; \
14    done; \
15    for ver in $versions; \
16    do \
17      tmpver=$(echo $ver | sed 's/\.//g'); \
18      if test "$lasttmpver" != ""; \
19      then \
20        if test "$tmpver" -gt "$lasttmpver"; \
21        then \
22          lastver=$ver; \
23          lasttmpver=$tmpver; \
24        fi; \
25      else \
26        lastver=$ver; \
27        lasttmpver=$tmpver; \
28      fi; \
29    done; \
30    exec tclsh$lastver "$0" "$@"
31    #
32    # $Id$
33  #  #
34  # weed out certain undesirables from an eggdrop userlist  # weed out certain undesirables from an eggdrop userlist
35  # try just typing 'tclsh weed' to find out the options  # try just typing 'tclsh weed' to find out the options
# Line 20  Line 51 
51  # field exactly matched 40 characters it would save it with no spaces after  # field exactly matched 40 characters it would save it with no spaces after
52  # it and eggdrop would reject the user record.  I know I could have easily  # it and eggdrop would reject the user record.  I know I could have easily
53  # changed one character, but I couldn't help myself.  <grin>  # changed one character, but I couldn't help myself.  <grin>
54  #                                         5 march 96  #                                         5 march 1996
55  #  #
56  # <robey, 23jul96>:  # <robey, 23jul1996>:
57  #     upgrade for v2 userfiles  #     upgrade for v2 userfiles
58  # <bruce s, 4sep96>:  # <bruce s, 04sep1996>:
59  #     fixed xtra field from getting truncated  #     fixed xtra field from getting truncated
60  # <robey, 20sep96>:  # <robey, 20sep1996>:
61  #     stopped it from mangling channel ban lists  #     stopped it from mangling channel ban lists
62  # <Ec|ipse & dtM, 10jun97>:  # <Ec|ipse & dtM, 10jun1997>:
63  #     upgrade for v3 userfiles  #     upgrade for v3 userfiles
64  # <Ec|ipse 18jun97>:  # <Ec|ipse 18jun1997>:
65  #     added an option to remove users from unwanted channels  #     added an option to remove users from unwanted channels
66  # <Ec|ipse 28oct97>:  # <Ec|ipse 28oct1997>:
67  #     upgrade for v4 userfiles, with v3 converter  #     upgrade for v4 userfiles, with v3 converter
68  # <Ernst 8mar98>:  # <Ernst 8mar1998>:
69  #     fixed bug "list element in braces followed by X instead of space"  #     fixed bug "list element in braces followed by X instead of space"
70  #       (the use of "lrange" where you aren't sure if it's a list is bad)  #       (the use of "lrange" where you aren't sure if it's a list is bad)
71  #     fixed --CONSOLE item not being included, creating "user" --CONSOLE  #     fixed --CONSOLE item not being included, creating "user" --CONSOLE
72  # <Ernst 1apr98>:  # <Ernst 1apr1998>:
73  #     two more improper ocurrences of "lrange" removed  #     two more improper ocurrences of "lrange" removed
74  # <rtc 20sep1999>:  # <rtc 20sep1999>:
75  #     removed ancient way of determining the current time.  #     removed ancient way of determining the current time.
76    # <Tothwolf 21oct1999>:
77    #     [clock] isn't in all versions of Tcl...
78    # <guppy 12Apr2001>:
79    #     borrowed code from Tothwolf's Wolfpack to find tclsh better
80  #  #
81    
82  set exempt {*ban *ignore}  set exempt {*ban *ignore}
# Line 55  set stripops 0 ; set stripmasters 0 ; se Line 90  set stripops 0 ; set stripmasters 0 ; se
90  set chanrem {}  set chanrem {}
91  set convert 0  set convert 0
92    
93    if {![string compare "" [info commands clock]]} then {
94      set fd [open "/tmp/egg.timer." w]
95      close $fd
96      set CURRENT [file atime "/tmp/egg.timer."]
97      exec rm -f /tmp/egg.timer.
98    } else {
99  set CURRENT [clock seconds]  set CURRENT [clock seconds]
100    }
101    
102  if {$argc < 1} {  if {$argc < 1} {
103    puts stdout "\nUsage: weed <userfile> \[options\]"    puts stdout "\nUsage: weed <userfile> \[options\]"
# Line 282  proc loadUserFile {fname} { Line 324  proc loadUserFile {fname} {
324          lappend Hostmask($oldhandle) [string trim $hmList]          lappend Hostmask($oldhandle) [string trim $hmList]
325        } elseif {$handle == "-"} {        } elseif {$handle == "-"} {
326          # hostmask          # hostmask
327          set hmList [lindex $line 1]          set hmList [join [lrange $line 1 end]]
328          lappend Hostmask($oldhandle) [string trim $hmList]          lappend Hostmask($oldhandle) [string trim $hmList]
329        } elseif {$handle == "!"} {        } elseif {$handle == "!"} {
330          # channel          # channel

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23