From eaa24c9b99e5d02c741332aa7ecbbdd6081c29bd Mon Sep 17 00:00:00 2001 From: Nyr Date: Thu, 30 Apr 2020 22:55:24 +0200 Subject: [PATCH] Check for gnupg availability The gnupg package is not available by default in some Ubuntu 18.04 images. Check for it and install if required. --- wireguard-install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 9bf9555..661dbaf 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -241,7 +241,12 @@ if [[ ! -e /etc/wireguard/wg0.conf ]]; then apt-get install -y wireguard qrencode elif [[ "$os" == "ubuntu" && "$os_version" -eq 1804 ]]; then # Ubuntu 18.04 - # Repo is added manually so we don't depend on add-apt-repository + # Repo is added manually so we don't depend on add-apt-repository. + # gnupg is required to add the repo, we install it if not already present. + if ! dpkg -s gnupg &>/dev/null; then + apt-get update + apt-get install -y gnupg + fi apt-key add - << EOF -----BEGIN PGP PUBLIC KEY BLOCK-----