mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Version 2.3.2
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com> Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
@ -28,7 +28,7 @@ class Fix_Services(plugins.Plugin):
|
||||
'pip': ['scapy']
|
||||
}
|
||||
__defaults__ = {
|
||||
'enabled': False,
|
||||
'enabled': True,
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
@ -114,6 +114,7 @@ class Fix_Services(plugins.Plugin):
|
||||
other_other_last_lines = ''.join(
|
||||
list(TextIOWrapper(subprocess.Popen(['tail', '-n10', '/var/log/pwnagotchi.log'],
|
||||
stdout=subprocess.PIPE).stdout))[-10:])
|
||||
print(other_other_last_lines)
|
||||
# don't check if we ran a reset recently
|
||||
logging.debug("[Fix_Services]**** epoch")
|
||||
if time.time() - self.LASTTRY > 180:
|
||||
@ -137,6 +138,7 @@ class Fix_Services(plugins.Plugin):
|
||||
|
||||
# Look for pattern 2
|
||||
elif len(self.pattern2.findall(other_last_lines)) >= 5:
|
||||
logging.info("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n%s" % last_lines)
|
||||
if hasattr(agent, 'view'):
|
||||
display = agent.view()
|
||||
display.set('status', 'Wifi channel stuck. Restarting recon.')
|
||||
@ -183,7 +185,7 @@ class Fix_Services(plugins.Plugin):
|
||||
display.update(force=True)
|
||||
try:
|
||||
# Run the monstart command to restart wlan0mon
|
||||
cmd_output = subprocess.check_output("ifconfig wlan0 up && monstart", shell=True)
|
||||
cmd_output = subprocess.check_output("monstart", shell=True)
|
||||
self._status = "up"
|
||||
logging.info("[Fix_Services monstart]: %s" % repr(cmd_output))
|
||||
except Exception as err:
|
||||
@ -194,11 +196,11 @@ class Fix_Services(plugins.Plugin):
|
||||
|
||||
def logPrintView(self, level, message, ui=None, displayData=None, force=True):
|
||||
try:
|
||||
if level is "error":
|
||||
if level == "error":
|
||||
logging.error(message)
|
||||
elif level is "warning":
|
||||
elif level == "warning":
|
||||
logging.warning(message)
|
||||
elif level is "debug":
|
||||
elif level == "debug":
|
||||
logging.debug(message)
|
||||
else:
|
||||
logging.info(message)
|
||||
|
Reference in New Issue
Block a user