Skip to content

Commit

Permalink
Prevent duplicate entries for reported networks
Browse files Browse the repository at this point in the history
Due to duplicate entries in `/root/.api-report.json`, [this code](https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/plugins/default/grid.py#L90) incorrectly reports the number of pwned networks, resulting in incorrect stats on the [pwnagotchi.ai website](https://pwnagotchi.ai/).
  • Loading branch information
sayak-brm authored Nov 26, 2019
1 parent 722a916 commit d2c4479
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pwnagotchi/plugins/default/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def on_loaded(self):
logging.info("grid plugin loaded.")

def set_reported(self, reported, net_id):
reported.append(net_id)
if net_id not in reported:
reported.append(net_id)
self.report.update(data={'reported': reported})

def check_inbox(self, agent):
Expand Down

0 comments on commit d2c4479

Please sign in to comment.