summaryrefslogtreecommitdiff
path: root/auto/gpg-script.sh
blob: d3f3c67d9d9151e225d215f73827eee7b2a61183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
set -e

# Ensure we are jenkins user
if [ "$EUID" -ne 1006 ]; then
  >&2 echo "Please run as jenkins"
  exit 1
fi

if [ -f ~/.gnupg/pubring.kbx ]; then
  echo "GnuPG Keypair has already been generated."
else
  echo "Generating GnuPG keypair..."
  gpg --batch --gen-key > /dev/null 2>&1 <<EOF
  %no-protection
  Key-Type:1
  Key-Length:3072
  Subkey-Type:1
  Subkey-Length:3072
  Name-Real: VyOS Unofficial Signing Key
  Name-Email: signing@not-vyos.org
  Expire-Date:0
EOF
fi