mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-08 10:45:34 +08:00
add ngrok developemnt and curl request helpers (#392)
This commit is contained in:
12
tools/api/commands/device_lock
Executable file
12
tools/api/commands/device_lock
Executable 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@-
|
||||
12
tools/api/commands/install_profile
Executable file
12
tools/api/commands/install_profile
Executable 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@-
|
||||
12
tools/api/commands/remove_profile
Executable file
12
tools/api/commands/remove_profile
Executable 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@-
|
||||
10
tools/api/commands/restart_device
Executable file
10
tools/api/commands/restart_device
Executable 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@-
|
||||
Reference in New Issue
Block a user