This commit is contained in:
root
2022-06-26 18:21:36 +03:00
parent a8ec73b9ad
commit b170b31718

4
gen.py
View File

@@ -112,7 +112,7 @@ class Wireguard(TypedDict):
wg_state = Wireguard({}) wg_state = Wireguard({})
def wg_json(config="all"): def wg_if_status(config="all"):
cmd = ["/usr/bin/wg", "show", config, "dump"] cmd = ["/usr/bin/wg", "show", config, "dump"]
proc = Popen(cmd, proc = Popen(cmd,
stdout=PIPE, stdout=PIPE,
@@ -329,6 +329,6 @@ if __name__ == '__main__':
elif is_update: elif is_update:
update_configs() update_configs()
elif json: elif json:
print(wg_json()['wg0']['peers'][0]) print(wg_if_status()['wg0']['peers'][0])
else: else:
print(help_msg) print(help_msg)