Server IP : 104.244.120.118  /  Your IP : 216.73.216.198
Web Server : Apache
System : Linux ded5817.inmotionhosting.com 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 14:34:46 UTC 2026 x86_64
User : persoanlinjuryla ( 1006)
PHP Version : 8.5.13
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0555) :  /../../opt/dedrads/python/../python/../cms_tools/../python/../python/../python/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../../opt/dedrads/python/../python/../cms_tools/../python/../python/../python/../check_boxtrapper
#!/usr/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)
    #{.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