#------------------ Script by hazyoon.ir ------------------# #----------------- Copywrite of HIOXINDIA ------------------# #-------------- More scripts @www.hazyoon.ir ---------------# awk -F: '{ if($3>=500) print $1 }' /etc/passwd > userslist.txt ddm=$IFS IFS=" " dt=`date +%d` if [ $dt -gt 9 ];then logdate=`date | cut -d" " -f2,3` else logdate=`date | cut -d" " -f2,3,4` fi nolines=`cat userslist.txt | wc -l` lineno=1 echo > ftprep.txt while [ $lineno -lt $nolines ] || [ $lineno -eq $nolines ] do user=`sed -n "${lineno}p" userslist.txt` lineno=`expr $lineno + 1` nologs=`cat /var/log/messages | grep 'pure-ftp' | grep "$logdate" | grep $user | grep 'logged in' | wc -l` if [ $nologs -gt 0 ]; then echo -e $user '\t' $nologs times >> ftprep.txt fi done hostname=`hostname` email='support@hioxindia.com' (echo FTP Login Report;echo ----------------------;sort +1 -2 -n -r ftprep.txt) | mail -s "FTP report for $hostname" $email #------------ Script by hazyoon.ir -------------------------#