HEX
Server: nginx/1.29.3
System: Linux 11979.bigscoots-wpo.com 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: nginx (1068)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_open,proc_close,popen,show_source,cmd# Do not modify this line # 1684243876
Upload Files
File: //bigscoots/cpanel/resellerstats.sh
#!/bin/bash

# Get the list of resellers
resellers=$(whmapi1 --output=jsonpretty listresellers | jq -r '.data.reseller[]')

# Loop through each reseller
for reseller in $resellers; do
  # Fetch reseller stats
  stats=$(whmapi1 --output=jsonpretty resellerstats user=$reseller | jq '.data.reseller | {diskquota, diskused, user}')

  # Extract diskquota and diskused
  diskquota=$(echo $stats | jq -r '.diskquota')
  diskused=$(echo $stats | jq -r '.diskused')
  user=$(echo $stats | jq -r '.user')

  # Compare diskused and diskquota
  if (( $(echo "$diskused > $diskquota" | bc -l) )); then
    # Print the username along with diskquota and diskused
    echo "User: $user"
    echo "Disk Quota: $diskquota"
    echo "Disk Used: $diskused"
    echo "-----------------------------------"
  fi
done