Update totp.sh

This commit is contained in:
2023-09-13 20:56:03 +00:00
parent 88d3b91b87
commit f81a550832

18
totp.sh
View File

@@ -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