Mercurial > notdcc
annotate debian/dcc-server.cron.daily @ 3:b689077d4918
Ignore old patches
author | Peter Gervai <grin@grin.hu> |
---|---|
date | Tue, 10 Mar 2009 14:31:24 +0100 |
parents | f6716cb00029 |
children |
rev | line source |
---|---|
2
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
1 #! /bin/sh |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
2 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
3 # daily DCC cron job |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
4 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
5 # This script should be run daily or more often when there is a shortage |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
6 # of disk space to run dbclean to discard and compress old checksums. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
7 # It also discards old DCC client log files. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
8 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
9 #. By default it is installed in /usr/lib/dcc. Instead of being copied |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
10 # to a directory such as /etc/cron/daily on some systems, a symbolic link |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
11 # should be used. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
12 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
13 # Copyright (c) 2004 by Rhyolite Software |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
14 # |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
15 # Permission to use, copy, modify, and distribute this software for any |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
16 # purpose with or without fee is hereby granted, provided that the above |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
17 # copyright notice and this permission notice appear in all copies. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
18 # |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
19 # THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE DISCLAIMS ALL |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
20 # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
21 # OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
22 # BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
23 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
24 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
25 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
26 # SOFTWARE. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
27 # Rhyolite Software DCC 1.2.50-1.45 $Revision: 1.1 $ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
28 # Generated automatically from cron-dccd.in by configure. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
29 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
30 exec 1>&2 </dev/null |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
31 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
32 DCC_LOGGER="logger -s -p ${DCC_ERROR_LOG_FACILITY-mail.err} -t DCC" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
33 DCC_HOMEDIR=/var/lib/dcc |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
34 DEBUG= |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
35 QUIET=-q |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
36 # check the args once to get the home directory |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
37 while getopts "xh:a:" c; do |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
38 case $c in |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
39 x) set -x; DEBUG=-x; QUIET=;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
40 h) DCC_HOMEDIR="$OPTARG";; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
41 *) ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
42 esac |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
43 done |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
44 . $DCC_HOMEDIR/dcc_conf |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
45 # deal with bash reserved $UID and old versions of dcc_conf |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
46 if test 0"$DCC_CONF_VERSION" -lt 2 -a -z "$DCCUID" -a ! -z "$UID"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
47 DCCUID="$UID" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
48 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
49 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
50 USAGE="`basename $0`: [-x] [-h homedir] [-a args]" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
51 OPTIND=1 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
52 while getopts "xh:a:" c; do |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
53 case $c in |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
54 x) ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
55 h) ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
56 a) DBCLEAN_ARGS="$DBCLEAN_ARGS $OPTARG";; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
57 *) eval $DCC_LOGGER "$USAGE"; exit 1;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
58 esac |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
59 done |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
60 shift `expr $OPTIND - 1 || true` |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
61 if test "$#" -ne 0; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
62 eval $DCC_LOGGER "$USAGE" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
63 exit 1 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
64 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
65 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
66 # make the paths absolute and trim the per day/hour/minute business |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
67 LOGDIR=`echo $DCCM_LOGDIR \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
68 | sed -e "s@^[DHM]?@@" -e "s@^[^/]@$DCC_HOMEDIR/&@"` |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
69 USERDIRS=`echo $DCCM_USERDIRS \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
70 | sed -e "s@^[^/]@$DCC_HOMEDIR/&@"` |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
71 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
72 OARGS=64dDGNRPSVqi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
73 DBCLEAN_ARGS="$QUIET -h $DCC_HOMEDIR $DCC_LOG_ARGS $DBCLEAN_ARGS" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
74 GREY_DBCLEAN_ARGS=`echo "$DBCLEAN_ARGS" \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
75 | sed -e "s/-[eEt][ ]*[^ ]\{1,\}//g" \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
76 -e "s/\(-[$OARGS]\{1,\}\)[eEt][ ]*[^ ]\{1,\}/\1/g"` |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
77 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
78 # Removed old dccm log files. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
79 if test ! -z "$DBCLEAN_LOGDAYS"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
80 if test -d "$LOGDIR"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
81 find "$LOGDIR" -follow \( -name 'msg.*' -o -name 'tmp.*' \) \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
82 -mtime +$DBCLEAN_LOGDAYS \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
83 | xargs /bin/rm -f |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
84 # remove empty subdirectories |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
85 find "$LOGDIR" -follow -depth -name '[0-9]*' -type d \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
86 | xargs /bin/rmdir 2>/dev/null |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
87 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
88 # clean per-user logs |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
89 if test "$USERDIRS" != "" -a -d "$USERDIRS"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
90 find "$USERDIRS" -follow \( -name 'msg.*' -o -name 'tmp.*' \) \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
91 -mtime +$DBCLEAN_LOGDAYS \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
92 | xargs /bin/rm -f |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
93 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
94 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
95 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
96 # Notify users about new log files. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
97 # The file $DCC_LIBEXEC/webuser-notify must be a script that will send |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
98 # a suitable message. See the example in the cgi-bin directory. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
99 if test "$USERDIRS" != "" -a -d "$USERDIRS" \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
100 -a -x $DCC_LIBEXEC/webuser-notify; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
101 MARKER=$USERDIRS/notify.marker |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
102 touch $MARKER.new |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
103 if test -r $MARKER; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
104 NEWER="-newer $MARKER" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
105 else |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
106 NEWER= |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
107 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
108 # Find usernames with a pending message or with a new but not newer |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
109 # than new log files |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
110 # Avoid newer than new files to ensure we generate at most |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
111 # one notification per log file. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
112 find "$USERDIRS" -follow \( -name notify.pending \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
113 -o \( -name 'msg.*' $NEWER \) \) ! -newer $MARKER.new \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
114 | sed -n -e 's@.*/\([^/]*/[^/]*\)/log/msg\.[^/]*$@\1@p' \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
115 -e 's@.*/\([^/]*/[^/]*\)/notify.pending$@\1@p' \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
116 | sort -u \ |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
117 | $DCC_LIBEXEC/webuser-notify $DEBUG -d "$USERDIRS" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
118 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
119 mv -f $MARKER.new $MARKER |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
120 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
121 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
122 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
123 # trim the greylist database |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
124 case X"$GREY_ENABLE" in |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
125 [oO][nN]) |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
126 GREY_ENABLE=on |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
127 ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
128 X) |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
129 if test ! -z "$GREY_CLIENT_ARGS"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
130 GREY_ENABLE=on |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
131 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
132 ;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
133 esac |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
134 if test ! -z "$GREY_SRVR_ID" -a "$GREY_ENABLE" = on; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
135 SADDR=`expr "X$GREY_DCCD_ARGS" : ".*-[$OARGS]*a[ ]*\([^ ]*\).*"` |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
136 if test ! -z "$SADDR"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
137 SADDR="-a $SADDR" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
138 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
139 $DCC_LIBEXEC/dbclean -Gon -i $GREY_SRVR_ID $SADDR $GREY_DBCLEAN_ARGS |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
140 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
141 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
142 |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
143 # Delete old checksums from the dccd database if it seems dccd can run. |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
144 # For historical reasons, SRVR_ID set and DCCD_ENABLE nul |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
145 # turns on dccd |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
146 case "$DCCD_ENABLE" in |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
147 [oO][fF][fF]) DCCD_ENABLE=off;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
148 *) DCCD_ENABLE=on;; |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
149 esac |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
150 if test ! -z "$SRVR_ID" -a "$DCCD_ENABLE" = on; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
151 SADDR=`expr "X$DCCD_ARGS" : ".*-[$OARGS]*a[ ]*\([^ ]*\).*"` |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
152 if test ! -z "$SADDR"; then |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
153 SADDR="-a $SADDR" |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
154 fi |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
155 $DCC_LIBEXEC/dbclean -i $SRVR_ID $SADDR $DBCLEAN_ARGS |
f6716cb00029
Replace buggy stuff in deb dir, never make phone calls while working
Peter Gervai <grin@grin.hu>
parents:
diff
changeset
|
156 fi |