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.
This commit is contained in:
Nyr 2020-04-30 22:55:24 +02:00
parent 941f27bd2f
commit eaa24c9b99

View File

@ -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-----