Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-10-13 13:14:19 +02:00
parent 8452c865fc
commit 5c38203648

View File

@ -40,11 +40,12 @@ class GdriveSync(plugins.Plugin):
if file['title'] == folder_name: if file['title'] == folder_name:
return file['id'] return file['id']
return None return None
return None
def on_loaded(self): def on_loaded(self):
# client_secrets.json needs to be in /root # client_secrets.json needs to be not empty
if not os.path.exists("/root/client_secrets.json"): if os.stat("/root/client_secrets.json").st_size == 0:
logging.error("client_secrets.json not found in /root. Please RTFM!") logging.error("[gDriveSync] /root/client_secrets.json is empty. Please RTFM!")
return return
# backup file, so we know if there has been a backup made at least once before. # backup file, so we know if there has been a backup made at least once before.
if not os.path.exists("/root/.gdrive-backup"): if not os.path.exists("/root/.gdrive-backup"):
@ -109,6 +110,7 @@ class GdriveSync(plugins.Plugin):
self.backup = True self.backup = True
with open("/root/.gdrive-backup", "w").close(): with open("/root/.gdrive-backup", "w").close():
pass # Create an empty file pass # Create an empty file
# reboot so we can start opwngrid with backup id
pwnagotchi.reboot() pwnagotchi.reboot()
# all set, gdriveSync is ready to run # all set, gdriveSync is ready to run