From acfbeeee5d7c6f56428de4c3fdcb5fbeab6448de Mon Sep 17 00:00:00 2001 From: Pavel Muhortov Date: Wed, 16 Aug 2023 14:50:32 +0300 Subject: [PATCH] "persistent-keepalive = off" handling --- wg_status.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wg_status.py b/wg_status.py index 75e1265..ccc6150 100755 --- a/wg_status.py +++ b/wg_status.py @@ -133,6 +133,10 @@ def wg_dmp() -> list: if len(line_list) == 5: pass if len(line_list) == 9: + try: + i_ka = int(line_list[8]) + except ValueError: + i_ka = 0 peer_list.append( { "name": line_list[1], @@ -141,7 +145,7 @@ def wg_dmp() -> list: "b_rx": int(line_list[6]), "b_tx": int(line_list[7]), "p_lh": int(line_list[5]), - "i_ka": int(line_list[8]), + "i_ka": i_ka, "w_if": w_if } )