From 1b8c53f29a73abf8c8adda23a25f035c21780a90 Mon Sep 17 00:00:00 2001 From: Asara Date: Wed, 19 Oct 2022 23:05:33 -0400 Subject: [PATCH] Clean up readme, match exact name --- otpish | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/otpish b/otpish index 09f0105..df7503b 100755 --- a/otpish +++ b/otpish @@ -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="&"