23
2
Fork 0

How to get all validated captchas ?

This commit is contained in:
root 2021-08-31 14:25:05 +02:00
parent f7434c5b65
commit 46be1a990b
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#! /bin/bash
dates=$(zcat /var/log/ejabberd/ejabberd* 2> /dev/null | grep "was registered" \
| cut -d[ -f 1 | cut -c 1-16)
SAVEIFS=$IFS # Save current IFS
IFS=$'\n' # Change IFS to new line
dates=($dates) # Split to array
IFS=$SAVEIFS # Restore IFS
greppattern=""
for (( i=0; i<${#dates[@]}; i++ ))
do
greppattern="$greppattern -e \"$(echo ${dates[$i]})\""
done
#echo -e ${greppattern}
grepcommand="ls -lt --full-time /var/lib/ejabberd/chapril_captchas | grep $greppattern | cut -d ' ' -f 9"
eval $grepcommand