From 6145655c66b95d3ec32daa5f9a1cf8598522e330 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Mon, 18 Sep 2023 09:17:01 +0200 Subject: [PATCH] v2.4.1 Signed-off-by: Jeroen Oudshoorn --- .../plugins/default/internet-connection.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pwnagotchi/plugins/default/internet-connection.py b/pwnagotchi/plugins/default/internet-connection.py index 4904f1cf..86c8c3df 100644 --- a/pwnagotchi/plugins/default/internet-connection.py +++ b/pwnagotchi/plugins/default/internet-connection.py @@ -35,13 +35,12 @@ class InternetConnectionPlugin(plugins.Plugin): text_font=fonts.Small)) def on_ui_update(self, ui): - with ui._lock: - # check if there is an active Internet connection - try: - # use the 'ping' command to check if we can reach a well-known website - output = subprocess.check_output(['ping', '-c', '1', 'google.com']) - # if the command was successful, it means there is an active Internet connection - ui.set('connection_status', ' connected') - except subprocess.CalledProcessError: - # if the command failed, it means there is no active Internet connection - ui.set('connection_status', ' disconnected') + # check if there is an active Internet connection + try: + # use the 'ping' command to check if we can reach a well-known website + output = subprocess.check_output(['ping', '-c', '1', 'google.com']) + # if the command was successful, it means there is an active Internet connection + ui.set('connection_status', ' connected') + except subprocess.CalledProcessError: + # if the command failed, it means there is no active Internet connection + ui.set('connection_status', ' disconnected')