Check if /etc/apt/apt.conf.d first exists

For example, it doesn't make sense to add this to centos / fedora
DIBs.

Change-Id: If7574c84e135f447d9601140dae138242162c2d2
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-03-08 14:40:55 -05:00
parent 7142c2193a
commit 60103bda5e
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ sudo mkdir -p /etc/nodepool
sudo chmod 777 /etc/nodepool
EOF
cat > /tmp/50-apt-allow-unauthenticated <<EOF
echo "APT::Get::AllowUnauthenticated \"true\";" | sudo tee \$TARGET_ROOT/etc/apt/apt.conf.d/95allow-unauthenticated
if [ -d "\$TARGET_ROOT/etc/apt/apt.conf.d" ]; then
echo "APT::Get::AllowUnauthenticated \"true\";" | sudo tee \$TARGET_ROOT/etc/apt/apt.conf.d/95allow-unauthenticated
fi
EOF
sudo mv /tmp/01-nodepool-setup \
$(dirname $NODEPOOL_CONFIG)/elements/nodepool-setup/install.d/01-nodepool-setup