AkurAI Build
Menu

AkurAI-Build

public

Latest change b2fb6810b8844f39a9752f65118c05ffecf28160 - Fold AkurAI EC2 operations into Build CLI by Ólafur Búi Ólafsson

set -euo pipefail
recipient="$1"
sudo install -d -o root -g root -m 0700 /etc/omp-workbench-backup/gnupg
sudo install -d -o root -g root -m 0700 /var/backups/omp-workbench
if ! sudo gpg --batch --homedir /etc/omp-workbench-backup/gnupg --with-colons --list-keys "$recipient" 2>/dev/null | grep -q '^pub:'; then
  # Unattended recovery intentionally uses a root-only keyring without a
  # passphrase; storing an automation passphrase beside it adds no host boundary.
  sudo gpg --batch --homedir /etc/omp-workbench-backup/gnupg --passphrase '' \
    --quick-generate-key "$recipient" rsa3072 encrypt 0
fi
sudo gpg --batch --homedir /etc/omp-workbench-backup/gnupg --armor --export "$recipient"