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

Dir : /opt/tier1adv/bin/
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/tier1adv/bin/setmaxemails

#!/bin/bash
# sets maxemails for a user
# updated by vanessa v.  5/23/12

CPVER=$(cat /usr/local/cpanel/version  | cut -d. -f2)

function rebuild(){

        sudo /scripts/build_maxemails_config

	if [ "$CPVER" -lt 32 ];then
	        sudo /scripts/update_email_limits
	else
		sudo /scripts/updateuserdomains
	fi

}

# checks for input

if [ "$1" == "" ];
then
        echo ""
        echo "Missing user name..."
	exit 1
        echo ""

elif ! /bin/ls -A /var/cpanel/users/$1 > /dev/null;
then
    	echo ""
        echo "User does not exist"
	exit 1
        echo ""

elif [ "$2" == "" ];
then
        echo ""
        echo "You need to specify an hourly limit"
	exit 1
        echo ""

elif [ "$2" -gt "750" ];
then
        echo ""
        echo "You are not allowed to set maxemails higher than 750 - please ask a system admin"
	exit 1
        echo ""

elif  grep MAX_EMAIL_PER_HOUR /var/cpanel/users/$1 >/dev/null
then
        echo ""
	sed -e '/MAX_EMAIL_PER_HOUR/d' -i /var/cpanel/users/$1 >/dev/null
	echo "MAX_EMAIL_PER_HOUR=$2" >> /var/cpanel/users/$1
	rebuild
	echo "$1 enabled to send up to $2 emails per hour"
        echo ""

else
        echo ""
        echo "MAX_EMAIL_PER_HOUR=$2" >> /var/cpanel/users/$1
	rebuild
        echo "$1 added to sent up to $2 emails per hour"

fi