Files
Installomator/MDM/-install swiftDialog direct condition.sh
2022-09-19 21:40:03 +02:00

18 lines
593 B
Bash
Executable File

#!/bin/sh
gitusername="bartreardon"
gitreponame="swiftDialog"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
destFile="/Library/Application Support/Dialog/Dialog.app"
versionKey="CFBundleShortVersionString" #CFBundleVersion
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
#echo "Let's install…"
exit 0
else
#echo "No need!"
exit 1
fi