PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /opt/sharedrads/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //opt/sharedrads/check_boxtrapper

#!/bin/bash


LINESDEF="900000"

test "$2" == "--lines" && LINES=$3

MAIL_LOG="/var/log/exim_mainlog";
if [ ! -f $MAIL_LOG ]; then
        echo "Can't find $MAIL_LOG - bailing."
        exit 1;
fi

function pusage () {

    echo;echo "$0 --logs"
    echo "This will check the exim_mainlog for boxtrapper wars.  It's the
    most effective way to find a boxtrapper going on now, and is the default
    action taken by this script"


    echo;echo "$0 --scan"
    echo "This script will review the size of all boxtrapper log
    folders - it is intensive and can take up to an hour to complete
    if the server is heavily loaded.  Use with care."
#
#echo "Flags for this script are taken from 'du' flags. Common
#usage is described below:"
#
#echo;echo "$0 --logs  -h"
#echo "Human readable sizes";echo;
#
#echo;echo "$0 --logs  -b"
#echo "Display directory size in bytes (best when piped to sort
#-nk1 for directory listing - $0 --logs -b | sort -nk2)";echo;
#
#echo;echo "$0 --help"
#echo "This information blob.";
#
#


}

check_exim_boxtrapper () {
    echo "Scanning $MAIL_LOG for boxtrapper wars - big numbers are bad (usually 1k-> >100K).  You can ignore 'transport'."
    tail -${LINES:-$LINESDEF} /var/log/exim_mainlog | awk '/boxtrapper/{print $6}' | sort | uniq -c | sort -nk1
}


if [ -z $1 ];
then
    pusage
fi

case $1 in
--help)
    pusage
    ;;
--scan)
    DUOPT=""
    #{.2} == /home/ and /home2/
    for account in /home{,2}/*/etc/*/*/
    do
        if [ -d "${account}boxtrapper/log" ]
        then
            du -h --max-depth=1 ${account}boxtrapper/log
        fi
    done
    ;;

--logs)
    check_exim_boxtrapper
    ;;
    *)
    check_exim_boxtrapper
    ;;
esac