first try
This commit is contained in:
17
etc-cron.daily-anonymize-pafal
Executable file
17
etc-cron.daily-anonymize-pafal
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# simple cronjob to anonymize IPv4 and IPv6 addresses
|
||||
# in pafakedaccesslog logfile entries
|
||||
# on a Debian GNU/Linux default Apache2 and PHP installation
|
||||
# placed in /etc/cron.daily/ .
|
||||
|
||||
# config
|
||||
readonly LOG="/var/www/html/pafal/faccess.log"
|
||||
|
||||
# ipv4
|
||||
/bin/sed -i -E 's/^([[:digit:]]{1,3}\.)([[:digit:]]{1,3}\.)([^ ]*)(.*)/\1\20.0\4/' "${LOG}"
|
||||
|
||||
# ipv6
|
||||
/bin/sed -i -E 's/^([[:xdigit:]]{1,4}:)([[:xdigit:]]{1,4}:)([[:xdigit:]]{1,4}:)([^ ]*)(.*)/\1\2\3:0\5/' "${LOG}"
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user