Add output for missing secret
This commit is contained in:
parent
38aa163634
commit
194435e52c
1 changed files with 4 additions and 0 deletions
4
otpish
4
otpish
|
@ -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)" = "period" ]; then period=$(echo ${i} | cut -d'=' -f2); fi
|
||||
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}
|
||||
exit
|
||||
fi
|
||||
|
|
Reference in a new issue