Rev | Line | |
---|
[1] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | [[ ${#} = 1 ]] || exit 42
|
---|
| 4 |
|
---|
| 5 | SAMHAIN_DB='samhain'
|
---|
| 6 | SAMHAIN_SRV='localhost'
|
---|
| 7 | SAMHAIN_PRT='3306'
|
---|
| 8 | SAMHAIN_USR='samhain'
|
---|
| 9 | SAMHAIN_PWD='*******'
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | mysql -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 |
|
---|
| 17 | mysql -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.