#!/bin/bash

set -e

output=`mktemp`
# WHEN multiple JDKs are installed
apt-get install -y openjdk-11-jdk openjdk-17-jdk openjdk-8-jdk | tee ${output}

# THEN installation is successful
if [[ $(grep -L "Adding debian:Amazon_Root_CA_1.pem" ${output}) ]]; then
    echo "Certificates were not imported !!!"
    exit 255
fi
rm $output
