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