Skip to content

Commit

Permalink
[preinst] Check for pre-existing pgp key (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsalvador-dsalvador authored and olivielpeau committed Mar 13, 2017
1 parent fd7440e commit e9e3f34
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package-scripts/datadog-agent/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ if [ "$DISTRIBUTION" != "Darwin" ]; then

# Prepare the GPG keys rotation:
# Add the new one to the list of trusted APT keys.
# Some servers are on severely restricted networks.
# Check if key already exists.
echo "Prepare Datadog Agent keys rotation"
echo -n " Add the new 'Datadog, Inc <package@datadoghq.com>' key to the list of APT trusted keys."
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 382E94DE >/dev/null 2>&1 && echo " ... OK" || echo " ... failed"

if $( apt-key finger | grep -q 'A292 3DFF 56ED A6E7 6E55 E492 D3A8 0E30 382E 94DE' ); then
echo "... key already installed"
else
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 382E94DE >/dev/null 2>&1 && echo " ... OK" || echo " ... failed"
fi
#DEBHELPER#

elif [ -f "/etc/redhat-release" ] || [ -f "/etc/system-release" ] || [ -f "/etc/SuSE-release" ] || [ "$DISTRIBUTION" == "RedHat" ] || [ "$DISTRIBUTION" == "CentOS" ] || [ "$DISTRIBUTION" == "openSUSE" ] || [ "$DISTRIBUTION" == "Amazon" ] || [ "$DISTRIBUTION" == "SUSE" ] || [ "$LINUX_DISTRIBUTION" == "Arista" ]; then
Expand Down

0 comments on commit e9e3f34

Please sign in to comment.