Clean up readme, match exact name

This commit is contained in:
Amarpreet Minhas 2022-10-19 23:05:33 -04:00
parent e15f56019d
commit 1b8c53f29a

25
otpish
View file

@ -9,15 +9,20 @@ PRIVKEY=${OTPISH_HOME}/privkey
PUBKEY=${OTPISH_HOME}/pubkey
print_help() {
echo otpish is a little wrapper around oathtool
echo this was just thrown together an is probably not prod ready
echo it stores your password encrypted key at ~/.otpish/key
echo it stores your encrypted otp secret keys in ~/.otpish/otp
echo depends on: $(for i in ${DEPENDS[@]}; do echo -n "${i} "; done)
echo commands:
echo help print this help
echo dump dump out all raw otpauth uris
echo get get otp code with passed name
cat << EOF
otpish is a little wrapper around oathtool
this was just thrown together an is probably not prod ready
it stores your password encrypted key at ~/.otpish/key
it stores your encrypted otp secret keys in ~/.otpish/otp
the app depends on: $(for i in ${DEPENDS[@]}; do echo -n "${i} "; done)
commands:
help print this help
dump dump out all raw otpauth uris
get requires a name, returns an otp
EOF
}
if [ "${COMMAND}" = "help" ]; then
@ -56,7 +61,7 @@ fi
if [ "${COMMAND}" = "get" ]; then
if [ -z ${NAME} ]; then echo get requires a name; exit; fi
if ! [ -f ${OTP} ]; then echo no otps configured add one first; exit; fi
uri=$(age -i ${PRIVKEY} -d ${OTP} | grep "${NAME}?")
uri=$(age -i ${PRIVKEY} -d ${OTP} | grep "/${NAME}?")
otp_info=$(echo -n ${uri} | cut -d '?' -f 2)
oIFS=${IFS}
IFS="&"