2017-12-05 22:39:10 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-01-23 19:51:45 -08:00
|
|
|
# Interactively generates an OTP-auth url (written for pass-otp)
|
2017-12-05 22:39:10 -08:00
|
|
|
#
|
|
|
|
# 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
|
2017-12-05 22:39:10 -08:00
|
|
|
|
2018-01-23 19:51:45 -08:00
|
|
|
echo "otpauth://${type:-totp}/$label?secret=$secret&issuer=${issuer:-$label}"
|