source: trunk/scripts/samhain-scripts/samhain.clearhost@ 4

Last change on this file since 4 was 1, checked in by katerina, 19 years ago

Initial import

File size: 547 bytes
Line 
1#!/bin/sh
2
3[[ ${#} = 1 ]] || exit 42
4
5SAMHAIN_DB='samhain'
6SAMHAIN_SRV='localhost'
7SAMHAIN_PRT='3306'
8SAMHAIN_USR='samhain'
9SAMHAIN_PWD='*******'
10
11
12mysql -u ${SAMHAIN_USR} --password=${SAMHAIN_PWD} ${SAMHAIN_DB} \
13 -P ${SAMHAIN_PRT} -h ${SAMHAIN_SRV} \
14 -e 'select count(*) from log where log_host="'${1}'";' || \
15( echo "SELECT FAILED" && exit 42 )
16
17mysql -u ${SAMHAIN_USR} --password=${SAMHAIN_PWD} ${SAMHAIN_DB} \
18 -P ${SAMHAIN_PRT} -h ${SAMHAIN_SRV} \
19 -e 'delete from log where log_host="'${1}'";' || \
20( echo "CLEANUP FAILED" && exit 42 )
21
Note: See TracBrowser for help on using the repository browser.