mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-08 11:41:54 +01:00
2529f69fba
Signed-off-by: DQ <dengq@vmware.com>
32 lines
941 B
Bash
Executable File
32 lines
941 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ ! -f ~/ca-bundle.crt.original ]; then
|
|
cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.original
|
|
fi
|
|
|
|
cp ~/ca-bundle.crt.original /etc/pki/tls/certs/ca-bundle.crt
|
|
|
|
if [ "$(ls -A /harbor_cust_cert)" ]; then
|
|
if grep -q "Photon" /etc/lsb-release; then
|
|
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."
|
|
else
|
|
echo "Current OS is not Photon, skip appending ca bundle"
|
|
fi
|
|
fi
|