Skip to content

Instantly share code, notes, and snippets.

@wellic
Forked from Ajnasz/get-totp-qr.sh
Created March 2, 2022 11:36
Show Gist options
  • Save wellic/6aa8d6bc73d8e2b1968f59e3a940ca79 to your computer and use it in GitHub Desktop.
Save wellic/6aa8d6bc73d8e2b1968f59e3a940ca79 to your computer and use it in GitHub Desktop.
#!/bin/sh
PATH_TO_ACCOUNT="/path/to/account"
PATH_TO_FILE="/path/to/file"
ACCOUNT_NAME="[email protected]"
ISSUER="Somewhere Org"
KEEPASS_PASSWORD="the secret password"
echo "$KEEPASS_PASSWORD" | keepassxc-cli show -a "TOTP Seed" "$PATH_TO_FILE" "$PATH_TO_ACCOUNT" | grep -v "Insert password" | while read i;do echo "otpauth://totp/$ACCOUNT_NAME?secret=$i&issuer=$ISSUER" | qr;done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment