From 97728ffe898c2f2c55e1269ee1792843cea6b328 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Tue, 9 Apr 2019 00:31:42 +0200 Subject: [PATCH] Provide own mapping of daemon names to ports --- attach.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/attach.py b/attach.py index 0591125..972b653 100644 --- a/attach.py +++ b/attach.py @@ -43,7 +43,20 @@ def main(): pid = get_pid(args.node) cmd = ' '.join(args.cmd) if args.daemon is not None: - cmd = "telnet localhost {}".format(args.daemon) + port_dict = { + "zebrasrv": 2600, + "zebra": 2601, + "ripd": 2602, + "ripngd": 2603, + "ospfd": 2604, + "bgpd": 2605, + "ospf6d": 2606, + "ospfapi": 2607, + "isisd": 2608, + "staticd": 2616, + } + + cmd = "telnet localhost {}".format(port_dict[args.daemon]) os.system("mnexec -a {} {}".format(pid, cmd))