mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-10 03:16:07 +08:00
21 lines
671 B
Bash
Executable File
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@-
|
|
|