最終更新 1 month ago

修正履歴 45924d25cd2543bb29d536732fdd99f7ed87a966

gistfile1.txt Raw
1root@wireguard:~# sed -n '/^def fw_events/,/^def [a-z]/p' /etc/wireguard/wgctl/core/json_helper.py | grep -n "return\|print\|sys.exit\|raise"
2root@wireguard:~# sed -n '/^def fw_events/,/^def [a-z]/p' /etc/wireguard/wgctl/core/json_helper.py | tail -20
3 try:
4 with open(conf) as f:
5 for line in f:
6 if line.startswith('Address'):
7 ip = line.split('=')[1].strip().split('/')[0]
8 ip_to_name[ip] = name
9 except Exception:
10 pass
11
12 # Load net services for reverse lookup — independent of rest of function
13 net_data = {}
14 if net_file and os.path.exists(net_file):
15 try:
16 with open(net_file) as f:
17 net_data = json.load(f)
18 except Exception:
19 pass
20
21