2018-11-09 08:02:59 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-10-17 09:28:53 +02:00
|
|
|
if [ ! -f ~/ca-bundle.crt.original ]; then
|
|
|
|
cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.original
|
2018-11-09 08:02:59 +01:00
|
|
|
fi
|
|
|
|
|
2019-10-17 09:28:53 +02:00
|
|
|
cp ~/ca-bundle.crt.original /etc/pki/tls/certs/ca-bundle.crt
|
|
|
|
|
|
|
|
if [ "$(ls -A /harbor_cust_cert)" ]; then
|
2018-11-09 08:02:59 +01:00
|
|
|
if grep -q "Photon" /etc/lsb-release; then
|
2019-10-17 09:28:53 +02:00
|
|
|
echo "Appending trust CA to ca-bundle ..."
|
|
|
|
for z in /harbor_cust_cert/*; do
|
|
|
|
case ${z} in
|
|
|
|
*.crt | *.ca | *.ca-bundle | *.pem)
|
|
|
|
if [ -d "$z" ]; then
|
|
|
|
echo "$z is dirictory, skip it ..."
|
|
|
|
else
|
|
|
|
cat $z >> /etc/pki/tls/certs/ca-bundle.crt
|
|
|
|
echo " $z Appended ..."
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*) echo "$z is Not ca file ..." ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
echo "CA appending is Done."
|
2018-11-09 08:02:59 +01:00
|
|
|
else
|
|
|
|
echo "Current OS is not Photon, skip appending ca bundle"
|
|
|
|
fi
|
2019-10-17 09:28:53 +02:00
|
|
|
fi
|