Add output for missing secret

This commit is contained in:
Amarpreet Minhas 2022-10-22 17:30:28 -04:00
parent 38aa163634
commit 194435e52c

4
otpish
View file

@ -72,6 +72,10 @@ if [ "${COMMAND}" = "get" ]; then
if [ "$(echo ${i} | cut -d'=' -f1)" = "digits" ]; then digits=$(echo ${i} | cut -d'=' -f2); fi if [ "$(echo ${i} | cut -d'=' -f1)" = "digits" ]; then digits=$(echo ${i} | cut -d'=' -f2); fi
if [ "$(echo ${i} | cut -d'=' -f1)" = "period" ]; then period=$(echo ${i} | cut -d'=' -f2); fi if [ "$(echo ${i} | cut -d'=' -f1)" = "period" ]; then period=$(echo ${i} | cut -d'=' -f2); fi
done done
if [ -z ${secret} ]; then
echo secret value unset, check otpish dump to make sure you added the uri correctly
exit
fi
oathtool --totp -b -s "${period:-30}s" -d ${digits:-6} ${secret} oathtool --totp -b -s "${period:-30}s" -d ${digits:-6} ${secret}
exit exit
fi fi