mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Disconnect BT when disabling plugin.
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:

committed by
Jeroen Oudshoorn

parent
d16fa0097c
commit
d1c5cd5e5d
@ -80,3 +80,9 @@ class BTTether(plugins.Plugin):
|
||||
def on_unload(self, ui):
|
||||
with ui._lock:
|
||||
ui.remove_element('bluetooth')
|
||||
try:
|
||||
mac = self.options['mac']
|
||||
subprocess.run(['nmcli', 'device', 'disconnect', f'{mac}'], check=True)
|
||||
logging.info(f"[BT-Tether] Disconnected from device with MAC: {mac}")
|
||||
except Exception as e:
|
||||
logging.error(f"[BT-Tether] Failed to disconnect from device: {e}")
|
Reference in New Issue
Block a user