add script for add trustRoot sert

This commit is contained in:
Arturius 2023-09-27 16:21:37 +03:00
parent 6857a3aafc
commit 1ef0523a3d

14
rootcerts.sh Normal file
View File

@ -0,0 +1,14 @@
#!/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}"