Correct unbound variable in ssl-ca element

The ssl-ca element assumes a DISTRO_NAME variable is available in
os-refresh-config scripts. This fails with:

    ../configure.d/51-ssl-load-ca-certs: DISTRO_NAME: unbound variable

Change-Id: Ic7f8d3b108848928bed1b4875927f03eb8b8d342
This commit is contained in:
Kiall Mac Innes 2015-01-08 16:45:38 +00:00
parent 629b175965
commit 8d426d42e8
1 changed files with 2 additions and 1 deletions

View File

@ -20,11 +20,12 @@ set -o pipefail
CA_CERT=/etc/ssl/from-heat-ca.crt
CA_CERT_SIZE=$(stat -c '%s' "$CA_CERT")
DISTRO=`lsb_release -si` || true
# A PEM encoded SSL Cert will have at least 54 characters for the START/END
# markers.
if [ $CA_CERT_SIZE -gt 54 ]; then
if [[ "ubuntu debian" =~ "${DISTRO_NAME}" ]]; then
if [[ "Ubuntu Debian" =~ "${DISTRO}" ]]; then
# On Debian, place the CA certificate where 'update-ca-certificates' will find it
cp ${CA_CERT} /usr/local/share/ca-certificates/from-heat-ca.crt
update-ca-certificates