mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
@ -2,8 +2,8 @@ import logging
|
||||
import json
|
||||
import toml
|
||||
import _thread
|
||||
import pwnagotchi.plugins as plugins
|
||||
from pwnagotchi import restart
|
||||
from pwnagotchi import restart, plugins
|
||||
from pwnagotchi.utils import save_config
|
||||
from flask import abort
|
||||
from flask import render_template_string
|
||||
|
||||
@ -499,13 +499,10 @@ class WebConfig(plugins.Plugin):
|
||||
elif request.method == "POST":
|
||||
if path == "save-config":
|
||||
try:
|
||||
parsed_toml = toml.loads(request.get_json())
|
||||
with open('/etc/pwnagotchi/config.toml') as config_file:
|
||||
toml.dump(parsed_toml, config_file)
|
||||
|
||||
save_config(request.get_json(), '/etc/pwnagotchi/config.toml') # test
|
||||
_thread.start_new_thread(restart, (self.mode,))
|
||||
return "success"
|
||||
except Exception as ex:
|
||||
logging.error(ex)
|
||||
return "config error"
|
||||
return "config error", 500
|
||||
abort(404)
|
||||
|
Reference in New Issue
Block a user