mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
save in dotted format
This commit is contained in:
@ -5,6 +5,9 @@ import threading
|
||||
import importlib, importlib.util
|
||||
import logging
|
||||
from pwnagotchi.ui import view
|
||||
from pwnagotchi import config
|
||||
from pwnagotchi.utils import save_config
|
||||
|
||||
|
||||
default_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "default")
|
||||
loaded = {}
|
||||
@ -36,11 +39,17 @@ def toggle_plugin(name, enable=True):
|
||||
|
||||
returns True if changed, otherwise False
|
||||
"""
|
||||
global loaded, database
|
||||
global loaded, database, config
|
||||
|
||||
if config:
|
||||
config['main']['plugins'][name] = enable
|
||||
save_config(config, '/etc/pwnagotchi/config.toml')
|
||||
|
||||
if not enable and name in loaded:
|
||||
if getattr(loaded[name], 'on_unload', None):
|
||||
loaded[name].on_unload(view.ROOT)
|
||||
del loaded[name]
|
||||
|
||||
return True
|
||||
|
||||
if enable and name in database and name not in loaded:
|
||||
|
Reference in New Issue
Block a user