Compare commits

...

2 Commits

2 changed files with 10 additions and 10 deletions

View File

@ -0,0 +1,6 @@
#!/usr/bin/env fish
set entry $argv[1]
set otp_secret (pass $entry | awk -F': ' '/^otp/{gsub(/\s/,"",$2);print $2}')
set otp_uri "otpauth://totp/totp-secret?secret=$otp_secret&issuer=$entry"
echo $otp_uri | pass otp append $entry

View File

@ -1,12 +1,6 @@
#!/usr/bin/env bash
# TODO: check for pass
key="$1"; shift
args=("$@")
otp="$(set -e; pass "$key" 2>/dev/null | grep -Pi '^otp' | cut -d ':' -f 2 | sed 's/ //g')"
otp_status="$?"
[[ $otp_status != 0 ]] && { echo "pass command failed with exit code $otp_status"; exit 1; }
[[ -z $otp ]] && { echo "No OTP secret found for pass entry '$key'"; exit 2; }
simple-otp "$otp"
echo 'This script is deprecated. Install and use the pass-otp extension.
yay -S pass-otp
pass otp $args'
exit 1