Merge branch 'pwnagotchi-torch-testing' into pwnagotchi-torch-64

This commit is contained in:
Jeroen Oudshoorn
2023-09-24 12:01:26 +02:00
5 changed files with 7 additions and 7 deletions

View File

@ -418,7 +418,7 @@
- name: install pwngrid 1.10.4 - name: install pwngrid 1.10.4
shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && sudo make && sudo make install" shell: "export GOPATH=$HOME/go && export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin && sudo make && sudo make install"
args: args:
executables: /bin/bash executable: /bin/bash
chdir: /usr/local/src/pwngrid chdir: /usr/local/src/pwngrid
when: pwngrid.changed when: pwngrid.changed

View File

@ -60,13 +60,15 @@ def closest_peer():
return all[0] if len(all) else None return all[0] if len(all) else None
def update_data(last_session, plugin_data): def update_data(last_session):
brain = {} brain = {}
try: try:
with open('/root/brain.json') as fp: with open('/root/brain.json') as fp:
brain = json.load(fp) brain = json.load(fp)
except: except:
pass pass
enabled = [name for name, options in pwnagotchi.config['main']['plugins'].items() if
'enabled' in options and options['enabled']]
data = { data = {
'session': { 'session': {
@ -85,7 +87,7 @@ def update_data(last_session, plugin_data):
'brain': brain, 'brain': brain,
'version': pwnagotchi.__version__, 'version': pwnagotchi.__version__,
'build': "Pwnagotchi-Torch by Jayofelony", 'build': "Pwnagotchi-Torch by Jayofelony",
'plugins': plugin_data 'plugins': enabled
} }
logging.debug("updating grid data: %s" % data) logging.debug("updating grid data: %s" % data)

View File

@ -131,8 +131,6 @@ def load(config):
enabled = [name for name, options in config['main']['plugins'].items() if enabled = [name for name, options in config['main']['plugins'].items() if
'enabled' in options and options['enabled']] 'enabled' in options and options['enabled']]
pwnagotchi.grid.update_data(None, enabled)
# load default plugins # load default plugins
load_from_path(default_path, enabled=enabled) load_from_path(default_path, enabled=enabled)

View File

@ -130,7 +130,7 @@ class Grid(plugins.Plugin):
with self.lock: with self.lock:
try: try:
grid.update_data(agent.last_session, None) grid.update_data(agent.last_session)
except Exception as e: except Exception as e:
logging.error("error connecting to the pwngrid-peer service: %s" % e) logging.error("error connecting to the pwngrid-peer service: %s" % e)
logging.debug(e, exc_info=True) logging.debug(e, exc_info=True)

View File

@ -40,7 +40,7 @@ class View(object):
self._width = self._layout['width'] self._width = self._layout['width']
self._height = self._layout['height'] self._height = self._layout['height']
self._state = State(state={ self._state = State(state={
'channel': LabeledValue(color=BLACK, label='CH', value='000', position=self._layout['channel'], 'channel': LabeledValue(color=BLACK, label='CH', value='00', position=self._layout['channel'],
label_font=fonts.Bold, label_font=fonts.Bold,
text_font=fonts.Medium), text_font=fonts.Medium),
'aps': LabeledValue(color=BLACK, label='APS', value='0 (00)', position=self._layout['aps'], 'aps': LabeledValue(color=BLACK, label='APS', value='0 (00)', position=self._layout['aps'],