From bc10be69a0c0ceefa925497ef7fae5c863bd4dae Mon Sep 17 00:00:00 2001
From: dadav <33197631+dadav@users.noreply.github.com>
Date: Fri, 4 Oct 2019 09:26:08 +0200
Subject: [PATCH] Add already submitted check

---
 .../pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py
index 30e136e..e3267e0 100644
--- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py
+++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/wpa-sec.py
@@ -44,10 +44,12 @@ def _upload_to_wpasec(path, timeout=30):
         payload = {'file': file_to_upload}
 
         try:
-            requests.post('https://wpa-sec.stanev.org/?submit',
+            result = requests.post('https://wpa-sec.stanev.org/?submit',
                     headers=headers,
                     files=payload,
                     timeout=timeout)
+            if ' already submitted' in result.text:
+                logging.warning(f"{path} was already submitted.")
         except requests.exceptions.RequestException as e:
             logging.error(f"WPA_SEC: Got an exception while uploading {path} -> {e}")
             raise e