diff --git a/otpish b/otpish index 8d3fa23..3a14f21 100755 --- a/otpish +++ b/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