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