#!/bin/bash if grep -q 'BEGIN PGP PUBLIC KEY BLOCK' "$1"; then cat "$1" else echo "# GPG file SHA256 checksum: $(sha256sum - <"$1" | cut -d\ -f1)" gpg --batch --decrypt 2>&1 "$1" fi