Device Scripting
Overview
Scripting is a feature that allows you to run a script unattended (written in any interpreted language you have installed on your Operating System) on any number of devices with a Linux or Windows based operating system.
This is useful when you have a repetitive action that you would like to perform on one or more devices.
These examples are for graphQL API scripting and do not apply to legacy.app.remote.it UI scripting. legacy.app.remote.it is deprecated and you should use this method.
Creating Scripts
Remote.It allows you to write scripts in any language your host operating system supports because the script is run just like any other executable script on your machine. This means you can write in bash, Python, Ruby, Node, etc., assuming you have the interpreter installed on your system. Scripts are executed as root.
Hello world script returning a value to Remote.It:
More example shell scripts can be found at our github repository:
https://link.remote.it/github/scripts
Files must be able to be uploaded in 30 seconds. If you need to have larger files, consider hosting at another location such as S3 and having your script fetch them.
Scripts can also have arguments which you can pass. Arguments can be created by placing commented lines like this in your code:
These arguments can then be used as environment variables in you code. See script examples for usage.
API
Below is a quick reference and not all functions are listed here. For full documentation, including working with scripting in an organization, please see Scripting API. You can also download and use our examples for Insomnia and Postman.
Uploading a Script
You can upload files using a multi form post to be run as a script or a file to be used by your scripts. Setting the executable flag will determine if the file can be run as a script (see scripting API docs).
You must be the account owner or if you belong to an organization, an admin on the account to upload a file. For full documentation, please see Scripting API.
Files must be able to be uploaded in 30 seconds. If you need to have larger files, consider hosting at another location such as S3 and having your script fetch them.
Running a Script
You can run your recent uploaded script with a graphQL mutation. This is a quick reference. For full documentation, please see Scripting API.
View files
Run Script without arguments
Run Script with arguments
This is a quick reference. For full documentation, please see Scripting API.
Get Script/Job Status
You can query for scripts status using the API. Attributes and Status set during the script will appear in the attribute list for the job. Filtering and sorting is available. This is a quick reference. For full documentation, please see Scripting API.
Last updated