rootcerts/rootcerts.sh

15 lines
571 B
Bash
Raw Normal View History

2023-09-27 13:21:37 +00:00
#!/bin/bash
DIR=~/rootcerts
mkdir -p "${DIR}"
curl --insecure https://git.dmin.pro/arturius/rootcerts/src/branch/master/rootcerts.pem.txt > ${DIR}/rootcerts.pem
cat "${DIR}/rootcerts.pem" | (cd $DIR && split -p '-----BEGIN CERTIFICATE-----' - cert- )
for c in ${DIR}/cert-* ; do
echo "security -v add-trusted-cert -d -r trustRoot -k \"/Library/Keychains/System.keychain\" \"$c\"" >> "${DIR}/tmp.sh"
done
if [ "$1" = "DS" ]; then
sudo sh "${DIR}/tmp.sh"
else
osascript -e "do shell script \"sh ${DIR}/tmp.sh\" with administrator privileges"
fi
rm -rf "${DIR}"