20 lines
468 B
Bash
20 lines
468 B
Bash
#!/bin/sh
|
|
|
|
addsecret() {
|
|
read -p "Insert secret GUID: " SECRET
|
|
read -p "Insert secret name: " SECRETNAME
|
|
docker exec -it totp-docker totp config update $SECRETNAME $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
|