From d51d3f61ac0c202afbf13bb2a2b99325da6b8cf8 Mon Sep 17 00:00:00 2001 From: Alex Muthmann Date: Fri, 25 Oct 2019 10:55:45 +0200 Subject: [PATCH] #391: Verify if the configured files exist --- pwnagotchi/plugins/default/auto-backup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/default/auto-backup.py b/pwnagotchi/plugins/default/auto-backup.py index 7c9901c2..41ceced0 100644 --- a/pwnagotchi/plugins/default/auto-backup.py +++ b/pwnagotchi/plugins/default/auto-backup.py @@ -39,8 +39,11 @@ def on_internet_available(agent): if READY: if STATUS.newer_then_days(OPTIONS['interval']): return - - files_to_backup = " ".join(OPTIONS['files']) + + # Only backup existing files to prevent errors + existing_files = list(filter(lambda f: os.path.exists(f), OPTIONS['files'])) + files_to_backup = " ".join(existing_files) + try: display = agent.view()