helm/bin/pass-otpuri

12 lines
349 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2018-01-23 19:51:45 -08:00
# Interactively generates an OTP-auth url (written for pass-otp)
#
# Example: passotpuri LABEL SECRET [QUERYSTRING]
2018-01-23 19:51:45 -08:00
read -p "Enter the label or issuer:" label
read -p "Enter its OTP secret:" secret
read -p "Enter type (leave blank for totp):" type
2018-01-23 19:51:45 -08:00
echo "otpauth://${type:-totp}/$label?secret=$secret&issuer=${issuer:-$label}"