Skip to content
This repository was archived by the owner on Jul 5, 2022. It is now read-only.

Remote command execution

Farshid Tavakolizadeh edited this page Jul 18, 2020 · 1 revision

Device Gateway can be configured for remote command execution on devices. Below are a few examples:

Inserting text/log messages

type: service
exec: sed -n 'w /path/to/output/file'

Input: HTTP PUT request body or from a subscribed MQTT message.

Getting log tail

type: task
exec: tail -1000 ~/logs/device-gateway.log

Output: HTTP GET request body or published to MQTT topic

Speaking words (macOS)

type: service
exec: while read line ; do echo $line | say ; done

Input: HTTP PUT request body or from a subscribed MQTT message.

Reboot

type: task  
exec: sudo reboot

Heartbeats

type: timer
interval: 10
exec: date

Output: HTTP GET request body or published to MQTT topic

Clone this wiki locally

⌂ 换网址