[2826] | 1 | #!/bin/sh |
---|
| 2 | ## |
---|
| 3 | ## updatedb_z2log.sh |
---|
| 4 | ## Login : <uli@pu.smp.net> |
---|
| 5 | ## Started on Tue Dec 12 03:45:32 2006 Uli Fouquet |
---|
| 6 | ## $Id$ |
---|
| 7 | ## |
---|
| 8 | ## Copyright (C) 2006 Uli Fouquet |
---|
| 9 | ## This program is free software; you can redistribute it and/or modify |
---|
| 10 | ## it under the terms of the GNU General Public License as published by |
---|
| 11 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 12 | ## (at your option) any later version. |
---|
| 13 | ## |
---|
| 14 | ## This program is distributed in the hope that it will be useful, |
---|
| 15 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | ## GNU General Public License for more details. |
---|
| 18 | ## |
---|
| 19 | ## You should have received a copy of the GNU General Public License |
---|
| 20 | ## along with this program; if not, write to the Free Software |
---|
| 21 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 22 | ## |
---|
| 23 | |
---|
| 24 | Z2_LOG=Z2.log |
---|
| 25 | PYZ2LOG=z2log.py |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | ## Read true values... |
---|
| 29 | if [ -f /etc/default/updatelogdb ]; then |
---|
| 30 | . /etc/default/updatelogdb |
---|
| 31 | fi |
---|
| 32 | |
---|
| 33 | # There may be more than one accesslog... |
---|
| 34 | #if [ ! -r $PYZ2LOG ]; then |
---|
| 35 | # echo "File not readable: $ACCESS_LOG"; |
---|
| 36 | # exit -1; |
---|
| 37 | #fi |
---|
| 38 | if [ ! -r $PYZ2LOG ]; then |
---|
| 39 | echo "File not readable: $PYZ2LOG"; |
---|
| 40 | exit -1; |
---|
| 41 | fi |
---|
| 42 | |
---|
| 43 | cat $Z2_LOG | python $PYZ2LOG | psql -q -h $HOST -d zevents -U $USER |
---|
| 44 | # > /dev/null 2>&1 |
---|
| 45 | |
---|
| 46 | |
---|