#!/bin/bash
#
sudo killall -9 "Microsoft Remote Desktop Beta"
/bin/mkdir -p "${HOME}/Desktop/downloadfromjamf"
sudo chmod -R 777 "${HOME}/Desktop/downloadfromjamf/"
cd "${HOME}/Desktop/downloadfromjamf"
ver=`sw_vers -productVersion | cut -d'.' -f1`
let ver="$ver"
if [ $ver -ge 12 ];then
else
/usr/bin/curl -o "./Microsoft Remote Desktop Beta.zip" http://aaaa.bbbb-admin.com/util/software/Microsoft%20Remote%20Desktop%20Beta%20Old.zip #旧版 fi
unzip -o "./Microsoft Remote Desktop Beta.zip"
sudo rm -Rf /Applications/Microsoft\ Remote\ Desktop\ Beta.app/
chmod -R 777 "${HOME}/Desktop/downloadfromjamf"
sudo /bin/cp -a "./Microsoft Remote Desktop Beta.app" /Applications/
(/usr/bin/osascript -e 'display dialog "成功安装RDP,已为您打开RDP的使用方法,请查看;您可以删除桌面上的downloadfromjamf目录,如果打开RDP出现错误,请重启电脑!" buttons {"OK"} default button "OK"')
#把文件夹权限置为 777 ,让所有人可以删
sudo chmod -R 777 "${HOME}/Desktop/downloadfromjamf/"
#cd ../
#rm -Rf "${HOME}/Desktop/downloadfromjamf"
exit 0