mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
fetch-release: check that only one key is imported
Co-authored-by: nixbitcoin <nixbitcoin@i2pmail.org>
This commit is contained in:
parent
5ab85cb2a5
commit
bc7d3a2ed7
@ -1,9 +1,11 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p bash coreutils curl jq gnupg
|
#!nix-shell -i bash -p bash coreutils curl jq gnupg gnugrep
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
|
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
|
||||||
|
|
||||||
|
trap 'echo "Error at ${BASH_SOURCE[0]}, line $LINENO"' ERR
|
||||||
|
|
||||||
repo=fort-nix/nix-bitcoin
|
repo=fort-nix/nix-bitcoin
|
||||||
if [[ ! -v version ]]; then
|
if [[ ! -v version ]]; then
|
||||||
version=$(curl -s --show-error "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name' | tail -c +2)
|
version=$(curl -s --show-error "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name' | tail -c +2)
|
||||||
@ -17,6 +19,8 @@ mkdir -p -m 700 "$GPG_HOME"
|
|||||||
|
|
||||||
# Import key
|
# Import key
|
||||||
gpg --homedir $GPG_HOME --import "$scriptDir/key-jonasnick.bin" &> /dev/null
|
gpg --homedir $GPG_HOME --import "$scriptDir/key-jonasnick.bin" &> /dev/null
|
||||||
|
# Check that exactly one key was imported
|
||||||
|
(($(gpg --list-keys --with-colons | grep -c pub) == 1))
|
||||||
# Verify key fingerprint
|
# Verify key fingerprint
|
||||||
gpg --homedir $GPG_HOME --list-keys "36C7 1A37 C9D9 88BD E825 08D9 B1A7 0E4F 8DCD 0366" > /dev/null
|
gpg --homedir $GPG_HOME --list-keys "36C7 1A37 C9D9 88BD E825 08D9 B1A7 0E4F 8DCD 0366" > /dev/null
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user