root@wireguard:~# sed -n '/^def fw_events/,/^def [a-z]/p' /etc/wireguard/wgctl/core/json_helper.py | grep -n "return\|print\|sys.exit\|raise" root@wireguard:~# sed -n '/^def fw_events/,/^def [a-z]/p' /etc/wireguard/wgctl/core/json_helper.py | tail -20 try: with open(conf) as f: for line in f: if line.startswith('Address'): ip = line.split('=')[1].strip().split('/')[0] ip_to_name[ip] = name except Exception: pass # Load net services for reverse lookup — independent of rest of function net_data = {} if net_file and os.path.exists(net_file): try: with open(net_file) as f: net_data = json.load(f) except Exception: pass