#!/bin/sh mailuserslist=`grep "dovecot: imap-login: Login:" /jails/mail/var/log/maillog | sed 's/.*rip=//g' | sed 's/, lip.*//g' | sort | uniq` && /sbin/pfctl -t trustedclients -T add $mailuserslist publickeyclientslist=`grep "Accepted publickey for" /var/log/auth.log /jails/*/var/log/auth.log | grep ssh2 | awk '{print $11}' | sort | uniq` && /sbin/pfctl -t trustedclients -T add $publickeyclientslist