tool to dump SOPS account info (including totp)
This commit is contained in:
parent
786282d9c4
commit
68f066229b
|
@ -231,6 +231,7 @@ in
|
||||||
# nixos-generators
|
# nixos-generators
|
||||||
# nettools
|
# nettools
|
||||||
nmap
|
nmap
|
||||||
|
oathToolkit # for oathtool
|
||||||
obsidian
|
obsidian
|
||||||
openssl
|
openssl
|
||||||
parted
|
parted
|
||||||
|
|
12
pkgs/sane-scripts/src/bin/sane-dump-secret
Executable file
12
pkgs/sane-scripts/src/bin/sane-dump-secret
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# use: `sane-dump-secret /path/to/accounts/website.yaml`
|
||||||
|
# dumps relevant information about the account, include a OTP code if present
|
||||||
|
secrets=$(sops -d --output-type dotenv $1)
|
||||||
|
function get_value() {
|
||||||
|
echo "$secrets" | grep "^$1=" | cut -d '=' -f 2-
|
||||||
|
}
|
||||||
|
echo username: $(get_value username)
|
||||||
|
echo password: $(get_value password)
|
||||||
|
totp=$(get_value totp-b32)
|
||||||
|
[[ -z "$totp" ]] || echo totp: $(oathtool -b --totp $totp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user