HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/local/cyberpanel/scripts/reset_bandwidth.sh
#!/bin/bash

# CyberPanel Bandwidth Reset Script
# This script resets bandwidth usage for all domains in CyberPanel

echo "CyberPanel Bandwidth Reset Script"
echo "================================="
echo ""

# Check if running as root
if [ "$EUID" -ne 0 ]; then
    echo "Please run as root (use sudo)"
    exit 1
fi

# Check if CyberPanel is installed
if [ ! -f "/usr/local/CyberCP/bin/python" ]; then
    echo "CyberPanel not found. Please ensure CyberPanel is installed."
    exit 1
fi

echo "Resetting bandwidth for all domains..."
echo ""

# Run the bandwidth reset script
/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/bandwidthReset.py --reset-all

if [ $? -eq 0 ]; then
    echo ""
    echo "Bandwidth reset completed successfully!"
    echo ""
    echo "To verify the reset, you can:"
    echo "1. Check the CyberPanel logs: /usr/local/lscp/logs/error.log"
    echo "2. Check individual domain bandwidth in CyberPanel web interface"
    echo "3. Check bandwidth metadata files: ls -la /home/cyberpanel/*.bwmeta"
else
    echo ""
    echo "Bandwidth reset failed. Please check the logs for details."
    echo "Log file: /usr/local/lscp/logs/error.log"
    exit 1
fi

echo ""
echo "Note: This script only resets the displayed bandwidth values."
echo "The actual bandwidth calculation will resume from the current access logs."
echo "For a complete reset, you may also need to clear access logs if desired."