gencert/testme.sh

31 lines
677 B
Bash
Raw Normal View History

2018-06-30 19:27:14 +00:00
#!/bin/bash
trap handle_term SIGINT SIGTERM
handle_term() {
echo "** Received SIGINT/SIGTERM signal"
cleanup;
}
cleanup() {
echo "** Cleaning up ..."
echo "WARNING, I am going to remove ${TMPDIR} entirely in 5 seconds!"
sleep 5
rm -rf "${TMPDIR}"
exit 0;
}
2018-06-30 19:27:14 +00:00
TMPDIR="$(mktemp -d)"
cp -v gencert.sh "${TMPDIR}/"
pushd "${TMPDIR}"
2018-07-11 07:35:42 +00:00
for DISTRO in alpine:3.4 alpine:3.7 ubuntu:bionic debian:stretch centos:7; do
2018-06-30 19:27:14 +00:00
printf "\n\n\nTesting the script with ${DISTRO} ...\n\n\n"
rm -vf openssl.cnf private.key public.crt ca.crt ca.key ca.srl
docker run --rm -t -v ${PWD}:/w -w /w ${DISTRO} sh gencert.sh --cn test.example.com $@
2018-06-30 19:27:14 +00:00
printf "\n\n\n"
done
popd
cleanup;