Update totp.sh
This commit is contained in:
18
totp.sh
18
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
|
||||
|
||||
Reference in New Issue
Block a user