Files
micromdm/tools/api/commands/set_auto_admin_password
2020-06-24 02:45:37 +00:00

21 lines
671 B
Bash
Executable File

#!/bin/bash
# populate and lock the account info for the setup assistant.
# Example:
# ./tools/api/commands/account_configuration_populate_user $udid "Full Name" "username"
#
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
hashPlist="$(go run ./tools/api/commands/account_configuration_managed_user.go | jq .auto_setup_admin_accounts[0].password_hash -r)"
jq -n \
--arg request_type "SetAutoAdminPassword" \
--arg udid "$1" \
--arg guid "$2" \
--arg hashPlist "$hashPlist" \
'.udid = $udid
|.guid = $guid
|.password_hash = $hashPlist
|.request_type = $request_type
'|\
curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-