#!/bin/bash # Documentation: # The configuration values must be provided to $3 must be a property list with the key/values for the configuration dictionary. # Example: # # # # # # baz # qux # count # 1 # foo # bar # # source $MICROMDM_ENV_PATH endpoint="v1/commands" jq -n \ --arg request_type "Settings" \ --arg udid "$1" \ --arg identifier "$2" \ --arg payload "$(cat $3|openssl base64 -A)" \ '.udid = $udid |.request_type = $request_type |.settings[0].item = "ApplicationConfiguration" |.settings[0].identifier = $identifier |.settings[0].configuration = $payload '|\ curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@-