Skip to main content

Scripts

Use Scripts to run commands or small programs across devices. Scripts can be parameterized, audited, and executed ad‑hoc or as part of deployments.

Script types

  • Inline: Write directly in the editor (bash, sh, PowerShell, etc.).
  • Template-linked: Scripts bundled with a Template for repeatable use.
  • Pre/Post-deploy hooks: Run before/after a Template deployment for validation and remediation.

Setting up a script (fields)

  • Name and Description: Human-friendly identifiers shown in lists and Events.
  • Interpreter: bash, sh, PowerShell (pwsh), or cmd depending on OS.
  • Script Source:
    • Inline editor: paste or type the script.
    • Template script: reference a script defined within a Template.
  • Parameters and Environment:
    • Parameters will be injected into the script at the wildcard position using ${PARAMETER}
  • Schedule (optional): run on a timed schedule (cron-like) if your deployment enables scheduling.

Run a script

  1. Open Scripts > New Script or choose an existing one.
  2. Choose interpreter and user:
    • Interpreter: bash/sh/pwsh/cmd depending on OS.
    • Run as: root or specified user (where supported). Prefer non-root for safety.
  3. Paste or type the script.
  4. you can use the run now button or you can run the script from the batch template area.

Run Types

  • Run Once: Runs only once as the script is recieved pon the target device. the user does not need to click ruun now it will automaticaly execute.
  • Run at startup: The script will execute each time the device boots.
  • Run at interval: The script will execute at the specified interval. the user does not need to click run now it will automaticaly execute.
  • Manual: The script will execute when the user clicks run now or when executed from a batch template execution.

Execution context and I/O

  • Stdout/Stderr are captured and displayed in the results panel; large outputs may be truncated with a download link for full logs.
  • Exit code determines success/failure per device.

Exit codes and idempotency

  • Exit code 0 = success; non-zero marks the device run as failed.
  • Aim for idempotent scripts so reruns won’t cause harm.

Examples

#!/usr/bin/env bash
set -euo pipefail

echo "Rotating logs older than ${RETENTION_DAYS:-30} days"
find /var/log -type f -mtime +"${RETENTION_DAYS:-30}" -delete

Safety

  • Use read-only service accounts where possible.
  • Test on a single device before batch execution.
  • Set conservative timeouts to prevent stuck processes.