HEX
Server: CentOS WebPanel: Protected by Mod Security
System: Linux sites.annaiservers.com 3.10.0-1160.118.1.el7.x86_64 #1 SMP Wed Apr 24 16:01:50 UTC 2024 x86_64
User: freeval (1012)
PHP: 8.1.10
Disabled: NONE
Upload Files
File: //scripts/bandwidth_run
#!/bin/bash
# Don't run this file directly as this is run by cwp update script

domain=$1
username=$2

bytes_file="/usr/local/apache/domlogs/$domain.bytes"
bytes=0

if [ -e "$bytes_file" ];then
	while read line; do
	    if  [[ "$line" =~ ^[0-9]+$ ]]; then
	        line=${line#0}
	        if [ ! -z "$line" ]; then
	            bytes=$(($bytes + $line))
	        fi
	    fi
	done < $bytes_file

	total=$(echo "$bytes / 1024 / 1024"|bc)
	echo "$total"
	echo "" > $bytes_file
else
    echo "0"
fi