initial commit of file from CVS for smeserver-webfilter on Sat Sep 7 16:44:31 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 16:44:31 +10:00
parent d8b207fd9e
commit 4e92e4ef80
87 changed files with 9052 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
#!/bin/bash
HOME=/root
LOG=$(/sbin/e-smith/db configuration getprop squid-db-logd status || echo 'disabled')
if [ "$LOG" != "enabled" ]; then
exit 0
fi
HOST=$(/sbin/e-smith/db configuration getprop squid-db-logd DbHost || echo 'localhost')
if [ "$HOST" != "localhost" ]; then
exit 0
fi
RETENTION=$(/sbin/e-smith/db configuration getprop squid-db-logd Retention || echo 370)
DB=$(/sbin/e-smith/db configuration getprop squid-db-logd DbName || echo squid_log)
echo "delete from access_log where date_day<DATE_SUB(NOW(), INTERVAL $RETENTION DAY);" | /usr/bin/mysql $DB
echo "delete from deny_log where date_day<DATE_SUB(NOW(), INTERVAL $RETENTION DAY);" | /usr/bin/mysql $DB