Mercurial > notdcc
comparison misc/logger @ 0:c7f6b056b673
First import of vendor version
author | Peter Gervai <grin@grin.hu> |
---|---|
date | Tue, 10 Mar 2009 13:49:58 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c7f6b056b673 |
---|---|
1 #! /bin/sh | |
2 | |
3 # write to stderr and the system log for systems such as SunOS that | |
4 # have `logger` without -s | |
5 | |
6 # Copyright (c) 2008 by Rhyolite Software, LLC | |
7 # | |
8 # This agreement is not applicable to any entity which sells anti-spam | |
9 # solutions to others or provides an anti-spam solution as part of a | |
10 # security solution sold to other entities, or to a private network | |
11 # which employs the DCC or uses data provided by operation of the DCC | |
12 # but does not provide corresponding data to other users. | |
13 # | |
14 # Permission to use, copy, modify, and distribute this software without | |
15 # changes for any purpose with or without fee is hereby granted, provided | |
16 # that the above copyright notice and this permission notice appear in all | |
17 # copies and any distributed versions or copies are either unchanged | |
18 # or not called anything similar to "DCC" or "Distributed Checksum | |
19 # Clearinghouse". | |
20 # | |
21 # Parties not eligible to receive a license under this agreement can | |
22 # obtain a commercial license to use DCC by contacting Rhyolite Software | |
23 # at sales@rhyolite.com. | |
24 # | |
25 # A commercial license would be for Distributed Checksum and Reputation | |
26 # Clearinghouse software. That software includes additional features. This | |
27 # free license for Distributed ChecksumClearinghouse Software does not in any | |
28 # way grant permision to use Distributed Checksum and Reputation Clearinghouse | |
29 # software | |
30 # | |
31 # THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE, LLC DISCLAIMS ALL | |
32 # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES | |
33 # OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE, LLC | |
34 # BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES | |
35 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
36 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
37 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
38 # SOFTWARE. | |
39 # Rhyolite Software DCC 1.3.103-1.9 $Revision$ | |
40 | |
41 exec 1>&2 | |
42 | |
43 USAGE="`basename $0`: [-x] [-p log_facility] [-t tag] message" | |
44 LOGGER_FACILITY= | |
45 TAG=DCC | |
46 while getopts "xp:t:" c; do | |
47 case $c in | |
48 x) set -x; DEBUG=yes;; | |
49 p) LOGGER_FACILITY="-p $OPTARG";; | |
50 t) TAG="$OPTARG";; | |
51 *) echo "$USAGE" 1>&2 | |
52 logger $LOGGER_FACILITY -t "$TAG" "$USAGE" | |
53 ;; | |
54 esac | |
55 done | |
56 shift `expr $OPTIND - 1 || true` | |
57 | |
58 echo "$*" | |
59 logger $LOGGER_FACILITY -t "$TAG" "$*" |