diff --git a/rootcerts.sh b/rootcerts.sh new file mode 100644 index 0000000..1f01889 --- /dev/null +++ b/rootcerts.sh @@ -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}"