annotate debian/dcc-server.cron.daily.diff @ 1:9b8d79ac0dc3

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