#!/bin/bash
#
/bin/mkdir -p "${HOME}/Desktop/downloadfromjamf"
cd "${HOME}/Desktop/downloadfromjamf"
unzip -o "./radar-webservices-ext.apple.com.cer.zip"
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "./radar-webservices-ext.apple.com.cer"
if [ $? -eq 0 ]; then
(/usr/bin/osascript -e 'display dialog "成功安装radar-webservices-ext.apple.com.cer证书,您可以删除桌面上的downloadfromjamf目录,如果出现错误,请重启电脑!" buttons {"OK"} default button "OK"')
else
(/usr/bin/osascript -e 'display dialog "安装radar-webservices-ext.apple.com.cer证书失败,您可以删除桌面上的downloadfromjamf目录,如果出现错误,请重启电脑!" buttons {"OK"} default button "OK"')
fi
#把文件夹权限置为 777 ,让所有人可以删
sudo chmod -R 777 "${HOME}/Desktop/downloadfromjamf/"
#cd ../
#rm -Rf "${HOME}/Desktop/downloadfromjamf"
exit 0