Claude assisted cleanup
This commit is contained in:
@@ -21,9 +21,22 @@ if [[ -z "$VAULT_ID" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Skip silently for the default vault ID (no named vault to look up)
|
||||
if [[ "$VAULT_ID" == "default" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ITEM_NAME="${VAULT_ID} vault key"
|
||||
FIELD_NAME="password"
|
||||
|
||||
# Skip silently if 1Password is not available or not authenticated
|
||||
if ! command -v op &>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
if [[ -z "$OP_SERVICE_ACCOUNT_TOKEN" && -z "$OP_CONNECT_HOST" && ! -S "${HOME}/.1password/agent.sock" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Fetch the vault password from 1Password
|
||||
VAULT_PASSWORD=$(op item get "$ITEM_NAME" --fields "$FIELD_NAME" --format=json --vault LabSecrets 2>/dev/null | jq -r '.value')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user