Overview
Commands can be sent to a single device through a direct Telnet session. However, when the same command needs to be applied across multiple Decoders, the commandallrx.sh utility provides a fast and efficient method to do so.
This command does not allow individual Decoder selection. It sends a command to multiple Decoders based on where it is executed.
Execution Behavior
The behavior of commandallrx.sh depends on where it is executed:
- Executed from an Encoder: The command is sent only to Decoders that are currently viewing that Encoder.
- Executed from a Decoder: The command is sent to all Decoders in the system.
This is useful for system-wide changes or targeting active viewing groups, but caution should be used when issuing commands that impact multiple devices.
Syntax
The commandallrx.sh script executes a command on multiple Decoders:
commandallrx.sh [command]
Where [command] is the command to be executed on each Decoder.
Command Requirements
- If the command contains spaces, it must be enclosed in double quotes.
- An ampersand (
&) appended inside the quotes executes the command in the background on each Decoder. This is required for longer-running commands. - An ampersand (
&) appended outside the quotes executes the script itself in the background on the local device.
Command Examples
- Command with spaces:
commandallrx.sh "start_image_pull 320 1 1" - Execute the command in the background on all Decoders:
commandallrx.sh "start_image_pull 320 1 1&" - Execute the command in the background on all Decoders and locally:
commandallrx.sh "start_image_pull 320 1 1&" &
How It Works
When commandallrx.sh is executed, the device performs the following sequence:
- Run
node_listlocally and identify all devices labeled asJustAddPower-RX. - Collect the IP addresses of those devices.
- Telnet into each device and send the command in sequence.
- Devices are processed in the order returned by
node_list.
- Devices are processed in the order returned by
- Execute the command on the local device last (firmware dependent).
The results of node_list determine which Decoders receive the command:
- Encoders only list Decoders that are actively connected to them.
- Decoders list all Decoders in the system.
This is what causes the difference in execution behavior.
Considerations
The following considerations should be kept in mind when using commandallrx.sh:
- Decoder-only targeting: This script only sends commands to Decoders. Encoders cannot be targeted.
- No command chaining: The
[command]cannot include a semicolon (;), preventing multiple commands from being executed in a single call. - Background execution required for certain commands: Commands such as
rebootmust include an ampersand (&) to execute properly. - Local execution may vary: Depending on firmware version, the command may not execute on the local device. If needed, execute the command locally afterward.
Common Use Cases
- Apply a command to all Decoders in the system:
Execute from any Decoder to broadcast the command system-wide.
commandallrx.sh "start_image_pull 320 1 1&" & - Apply a command only to Decoders viewing a specific Encoder:
Execute from the Encoder to target only the Decoders currently connected to it.
commandallrx.sh "e e_vw_enable_0_0_0_0&"

