MikroTik API icon

MikroTik API

Community Node for MikroTik RouterOS API

Actions67

System Script → Set

AI-generated

Summary

Update a system script on the MikroTik device.

Inputs

  • targetId (required) — ID (*1, *2) or Name (ether1, user1) of the script to set
  • scriptSource — Source code of the script
  • scriptPolicy — Comma separated policies (e.g. ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon)
  • commentText — Comment for the script

Output shape

An array containing one object with resource, operation, count, and data fields. data reflects the RouterOS API response; if cleanKeys is enabled, - and / in keys are replaced with _.

Connection retry logic (5 attempts, 3s delay) and global cleanKeys/tag options apply per node configuration.

Examples

Example 1: Set the source and policy of an existing script named 'backup'.

Target ID / Name: backup; Source: /system script; Policy: read,write; Comment: Updated backup script

Links

Discussion