From 3a6e45ad18c519b21c9cadb2d374148647886b05 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 24 Sep 2026 04:19:59 +0530 Subject: refactor: ran newly configured formatter for the whole project --- modules/security/ssh/gpg-ssh-key-load.sh | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'modules/security/ssh/gpg-ssh-key-load.sh') diff --git a/modules/security/ssh/gpg-ssh-key-load.sh b/modules/security/ssh/gpg-ssh-key-load.sh index 02dda1d..b9567f8 100644 --- a/modules/security/ssh/gpg-ssh-key-load.sh +++ b/modules/security/ssh/gpg-ssh-key-load.sh @@ -15,10 +15,13 @@ export GNUPGHOME="@@GNUPGHOME@@" GOPASS_SSH_KEY="@@GOPASS_SSH_KEY@@" -info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; } -warn() { printf '\033[1;33m==> warning:\033[0m %s\n' "$*" >&2; } +info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; } +warn() { printf '\033[1;33m==> warning:\033[0m %s\n' "$*" >&2; } error() { printf '\033[1;31m==> error:\033[0m %s\n' "$*" >&2; } -die() { error "$*"; exit 1; } +die() { + error "$*" + exit 1 +} usage() { cat </dev/null | grep -qE "(ED25519|RSA|ECDSA)"; then exit 0 fi -if ! gopass show -o "$GOPASS_SSH_KEY" > /dev/null 2>&1; then +if ! gopass show -o "$GOPASS_SSH_KEY" >/dev/null 2>&1; then die "no gopass entry $GOPASS_SSH_KEY" fi tmpdir=$(mktemp -d) trap 'rm -rf "$tmpdir"' EXIT keyfile="$tmpdir/key" -gopass show -o "$GOPASS_SSH_KEY" > "$keyfile" 2>/dev/null +gopass show -o "$GOPASS_SSH_KEY" >"$keyfile" 2>/dev/null chmod 600 "$keyfile" passphrase=$(gopass show -o "$GOPASS_SSH_KEY/passphrase" 2>/dev/null || true) @@ -82,4 +85,4 @@ if ! timeout 60 ssh-add "$keyfile"; then exit 1 fi -info "SSH key loaded into gpg-agent." \ No newline at end of file +info "SSH key loaded into gpg-agent." -- cgit v1.2.3