-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck32bit.sh
More file actions
22 lines (20 loc) · 1.16 KB
/
check32bit.sh
File metadata and controls
22 lines (20 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#set username, password, and JSS location
jssAPIUsername=""
jssAPIPassword=""
jssAddress=""
mobileApps=$(curl -H "Accept: application/JSON" -su ${jssAPIUsername}:${jssAPIPassword} -X GET ${jssAddress}/JSSResource/mobiledeviceapplications)
length=$(echo "$mobileApps"|./jq '.[]|length')
loopcount=0
while [ $loopcount -lt "$length" ]; do
jssappID=$(echo "$mobileApps"|./jq ".mobile_device_applications[$loopcount].id")
myOutput=$(curl -H "Accept: application/JSON" -su ${jssAPIUsername}:${jssAPIPassword} -X GET ${jssAddress}/JSSResource/mobiledeviceapplications/id/${jssappID})
adamURL=$(echo "$myOutput"|./jq '.mobile_device_application.general.external_url')
adamID=$(echo "$adamURL"|sed -e 's/.*\/id\(.*\)?.*/\1/')
adamIDquoted=\"$adamID\"
appleOutput=$(curl -s -H "Accept: application/JSON" -X GET "https://uclient-api.itunes.apple.com/WebObjects/MZStorePlatform.woa/wa/lookup?version=2&id=${adamID}&p=mdm-lockup&caller=MDM&platform=itunes&cc=us&l=en")
is32bit=$(echo "$appleOutput"|./jq .results.$adamIDquoted.is32bitOnly)
appName=$(echo "$appleOutput"|./jq .results.$adamIDquoted.name)
[ "$is32bit" == "true" ] && echo "$appName is 32bit only"
((loopcount++))
done