From 7a7b700dad91d90ace718f8c385ecbf5bb271acd Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Tue, 5 Sep 2023 21:22:44 +0200 Subject: [PATCH] Version 2.2.9: Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/bettercap.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pwnagotchi/bettercap.py b/pwnagotchi/bettercap.py index 96d4a5aa..628c3bff 100644 --- a/pwnagotchi/bettercap.py +++ b/pwnagotchi/bettercap.py @@ -55,14 +55,14 @@ class Client(object): logging.exception("Other error while opening websocket (%s) with parameter %s", e, s) -def run(self, command, verbose_errors=True): - for _ in range(0, 2): - try: - r = requests.post("%s/session" % self.url, auth=self.auth, json={'cmd': command}) - except requests.exceptions.ConnectionError as e: - logging.exception("Request connection error (%s) while running command (%s)", e, command) - sleep(1) # Sleep for 1-s before trying a second time - else: - break + def run(self, command, verbose_errors=True): + for _ in range(0, 2): + try: + r = requests.post("%s/session" % self.url, auth=self.auth, json={'cmd': command}) + except requests.exceptions.ConnectionError as e: + logging.exception("Request connection error (%s) while running command (%s)", e, command) + sleep(1) # Sleep for 1-s before trying a second time + else: + break - return decode(r, verbose_errors=verbose_errors) + return decode(r, verbose_errors=verbose_errors)