Skip to content

Instantly share code, notes, and snippets.

View 8ryder's full-sized avatar

Volodymyr Ivaniuta 8ryder

View GitHub Profile
#!/bin/bash
set -x
check(){
regex="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
checkaccounttokenproblem=$(tail -f /opt/zimbra/log/mailbox.log |grep --color -iE 'zimbraAuthTokens: no such value'|awk '{print $5}'|gawk -v RS='[[:alnum:]_.]+@[[:alnum:]_]+[.][[:alnum:]]+[.][[:alnum:]]+' 'RT{print RT}')
if [[ $checkaccounttokenproblem=~$regex ]] ; then
echo -e "\033[1;33m [+] Resetando token do usuario: \033[0m"; ${checkaccounttokenproblem}