From d9c584fae3803043669ac458a9f7d8059995a264 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 26 Apr 2024 22:10:10 +0000 Subject: [PATCH] sanchk for unique ports across services --- r0c/__main__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/r0c/__main__.py b/r0c/__main__.py index 4ea596d..6db3e2a 100644 --- a/r0c/__main__.py +++ b/r0c/__main__.py @@ -215,6 +215,15 @@ class Core(object): t = "\033[33mWARNING: you have localhost in --proxy, you probably want --ara too\033[0m" print(t) + taken = {} + for zs in "pt pn tpt tpn".split(): + zi = getattr(ar, zs, 0) + if zi in taken: + t = "port %d was specified for both -%s and -%s" + raise Exception(t % (zi, taken[zi], zs)) + if zi: + taken[zi] = zs + Util.HEX_WIDTH = ar.hex_w Itelnet.init(ar)