mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-10 01:46:17 +00:00
filter non-WG interfaces in data processing loop
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import uuid
|
|
||||||
import base64
|
import base64
|
||||||
import time
|
import os
|
||||||
import requests
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
# Global variables
|
# Global variables
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
@@ -211,6 +212,10 @@ def main_loop():
|
|||||||
|
|
||||||
# Process each interface and its peers, aggregate tx and rx for the interface
|
# Process each interface and its peers, aggregate tx and rx for the interface
|
||||||
for interface, peers in data.items():
|
for interface, peers in data.items():
|
||||||
|
if not isinstance(interface, str) or not interface.startswith("wg"):
|
||||||
|
if interface not in ['cache_information', 'status', 'message']:
|
||||||
|
debug_log(f"Skipping non-wg root key: {interface}")
|
||||||
|
continue
|
||||||
debug_log(f"Processing interface: {interface}")
|
debug_log(f"Processing interface: {interface}")
|
||||||
total_tx = 0
|
total_tx = 0
|
||||||
total_rx = 0
|
total_rx = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user