mirror of
https://github.com/lloeki/toolbelt.git
synced 2025-12-06 10:04:40 +01:00
18 lines
519 B
Bash
Executable file
18 lines
519 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
set -o nounset
|
|
|
|
certs=/usr/local/etc/openssl/cert.pem
|
|
tmp_certs=$(mktemp -t update-local-certificates)
|
|
|
|
security find-certificate -a -p \
|
|
/Library/Keychains/System.keychain \
|
|
/System/Library/Keychains/SystemRootCertificates.keychain \
|
|
/System/Library/Keychains/SystemCACertificates.keychain \
|
|
> "$tmp_certs"
|
|
|
|
if [ ! -f "$certs" ] || [ $(/sbin/md5 "$tmp_certs" | cut -d'=' -f2) != $(/sbin/md5 "$certs" | cut -d'=' -f2) ]; then
|
|
chmod a+r "$tmp_certs"
|
|
mv "$tmp_certs" "$certs"
|
|
fi
|