mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-05 08:55:51 +08:00
17 lines
658 B
Bash
17 lines
658 B
Bash
#!/bin/bash
|
|
# Install VPP application on device
|
|
# VPP app needs to be registered with the device serial number using the apple endpoint (https://vpp.itunes.apple.com/mdm/v2/assets/associate) before one can install it on a device
|
|
source $MICROMDM_ENV_PATH
|
|
endpoint="v1/commands"
|
|
jq -n \
|
|
--arg request_type "InstallApplication" \
|
|
--arg udid "$1" \
|
|
--arg itunes_store_id $2 \
|
|
'.udid = $udid
|
|
|.request_type = $request_type
|
|
|.itunes_store_id = ($itunes_store_id|tonumber)
|
|
|.options = {"purchase_method": 1}
|
|
'|\
|
|
curl $CURL_OPTS \
|
|
-H "Content-Type: application/json" \
|
|
-K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- |