mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-07-03 22:20:29 +08:00
feat(sagent): sagt op
This commit is contained in:
parent
38468291fc
commit
4af1aa4a4d
9
tools/sagent-op.sh
Executable file
9
tools/sagent-op.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
op=$(command -v op || command -v op.exe)
|
||||||
|
if [[ ! -x $op ]]; then
|
||||||
|
echo "1password cli not found"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
"$op" read "op://Personal/id25519-passphrase/$(hostname)"
|
@ -47,6 +47,12 @@ add_piv()
|
|||||||
list
|
list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_id25519_with_op()
|
||||||
|
{
|
||||||
|
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS="$THIS_DIR/sagent-op.sh" timeout 30s ssh-add ~/.ssh/id_ed25519 || fmt_fatal "timed out when adding the key. probably the passphrase is wrong"
|
||||||
|
list
|
||||||
|
}
|
||||||
|
|
||||||
list()
|
list()
|
||||||
{
|
{
|
||||||
echo echo "available keys:"
|
echo echo "available keys:"
|
||||||
@ -96,6 +102,9 @@ route()
|
|||||||
piv)
|
piv)
|
||||||
add_piv
|
add_piv
|
||||||
;;
|
;;
|
||||||
|
op)
|
||||||
|
add_id25519_with_op
|
||||||
|
;;
|
||||||
reset)
|
reset)
|
||||||
reset
|
reset
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user