add ngrok developemnt and curl request helpers (#392)

This commit is contained in:
Victor Vrantchan
2018-04-07 19:35:27 -04:00
committed by GitHub
parent 40d5c9cd34
commit f843041cbc
11 changed files with 255 additions and 0 deletions

12
tools/api/commands/device_lock Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
--arg request_type "DeviceLock" \
--arg udid "$1" \
--arg pin $2 \
'.udid = $udid
|.pin = $pin
|.request_type = $request_type
'|\
curl -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-

View File

@@ -0,0 +1,12 @@
#!/bin/bash
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
--arg request_type "InstallProfile" \
--arg udid "$1" \
--arg payload $(cat $2|base64) \
'.udid = $udid
|.payload = $payload
|.request_type = $request_type
'|\
curl -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-

View File

@@ -0,0 +1,12 @@
#!/bin/bash
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
--arg request_type "RemoveProfile" \
--arg udid "$1" \
--arg identifier $2 \
'.udid = $udid
|.identifier = $identifier
|.request_type = $request_type
'|\
curl -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-

View File

@@ -0,0 +1,10 @@
#!/bin/bash
source $MICROMDM_ENV_PATH
endpoint="v1/commands"
jq -n \
--arg request_type "RestartDevice" \
--arg udid "$1" \
'.udid = $udid
|.request_type = $request_type
'|\
curl -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@-