From 194435e52c28e736043ce601062371dca7efc3c6 Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 22 Oct 2022 17:30:28 -0400 Subject: [PATCH] Add output for missing secret --- otpish | 4 ++++ 1 file changed, 4 insertions(+) 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