#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <filename>"
exit 1
fi
awk 'NR % 2 == 0' $1wget https://raw.githubusercontent.com/certbot/certbot/75499277be6699fd5a9b884837546391950a3ec9/certbot-auto
chmod +x ./certbot-auto
./certbot-auto --no-self-upgrade
cd /var/vmail/vmail1/example.com/p/a/u/username-2005.09.20.12.30.07/Maildir
find . -type f | grep -E ',[^,]*S[^,]*$' # finds all readed
find . -type f | grep -vE ',[^,]*S[^,]*$' # find all unreaded
find . -type f | grep -vE ',[^,]*S[^,]*$' | wc -l # count them
find . -type f | grep -vE ',[^,]*S[^,]*$' | xargs rm # remove themtime awk '{ split($4,array,"[:/]"); print > "access-" array[3] "-" array[2] ".txt" }' access.log