From f81a5508329966690b6c1920acef28443773b354 Mon Sep 17 00:00:00 2001 From: Damir Ibragimov Date: Wed, 13 Sep 2023 20:56:03 +0000 Subject: [PATCH] Update totp.sh --- totp.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/totp.sh b/totp.sh index 2cd2185..77017dc 100644 --- a/totp.sh +++ b/totp.sh @@ -1,5 +1,19 @@ #!/bin/sh -read -p "Secret name: " SECRET +addsecret() { + read -p "Insert secret GUID: " SECRET + read -p "Insert secret name: " SECRETNAME + docker exec -it totp-docker totp config update $SECRETNAME $SECRET +} -docker exec -it totp-docker totp $SECRET +getcode() { + read -p "Insert secret name: " SECRETNAME + docker exec -it totp-docker totp $SECRETNAME +} + +read -p "Insert operation (add / get): " OPERATION + +if [[ $OPERATION == "add" ]]; then addsecret +elif [[ $OPERATION == "get" ]]; then getcode +else echo "Unknown input" +fi