get-otp: search for file in sync folder

This commit is contained in:
Guilherme Rugai Freire 2024-01-29 15:45:41 -03:00
parent a9a5ae6d0c
commit 6869c0ab9a
No known key found for this signature in database
GPG Key ID: AC1D9B6E48E16AC1

View File

@ -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: "