From 6869c0ab9a311647424c1ffd650967e7c5dde0b2 Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire Date: Mon, 29 Jan 2024 15:45:41 -0300 Subject: [PATCH] get-otp: search for file in sync folder --- get-otp/get-otp.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/get-otp/get-otp.sh b/get-otp/get-otp.sh index 54f991a..1843d9e 100755 --- a/get-otp/get-otp.sh +++ b/get-otp/get-otp.sh @@ -1,11 +1,12 @@ #!/bin/sh accounts_file=$1 +andotp_sync_folder="$HOME/.local/share/andotp" # Check if file path was provided if [ -z "$accounts_file" ]; then - echo "File not provided." - exit 1 + # Get from the andOTP backup/sync folder + accounts_file="$(find "$andotp_sync_folder" -type f -name \*.aes | sort -r | sed -n '1p')" fi printf "Password: "