JOD Worker Executor Shell
When an JOD Action must be executed, this executor execute the cmd
using the JavaExecProcess::execCmdConcat(String cmd) method.
Before execute the command, the cmd
string is updated and all his placeholder are replaced with current Pillar, State and Action properties.
After that execute the command.
Firmware Configs
cmd
String containing the shell command to execute via JavaExecProcess::execCmdConcat(String cmd) method with 5 seconds as timeout. It's mandatory.
The cmd
string can contain any available command on running machine and his all params.
It also support piped command (|
) for example echo "hello world" | sed 's/world/john/g'
.
The cmd
string can concatenate multiple commands with &&
.
The concatenated commands are executed independently, so before executing each cmd, this method wait for previous cmd termination.
Each cmd must be terminate before {@link #DEF_TIMEOUT}.
This property is updated with Pillar's Placeholder on worker initialization and with State Placeholder and Action Placeholder on executing action.
redirect
File path where write cmd
output. Default value ''.
If this firmware Configs is set, it used as file path for write command output as logs file.
This property is updated with Pillar's Placeholder on worker initialization and with State Placeholder and Action Placeholder on executing action.
Examples
"Volume Mute (Mac)" : {
"type": "BooleanAction",
"puller" : "shell://cmd=osascript -e 'output muted of (get volume settings)';freq=1",
"executor" : "shell://cmd=osascript -e 'set volume output muted %VAL_BOOL%'"
}
"Volume" : {
"type": "RangeAction",
"puller" : "shell://cmd=osascript -e 'output volume of (get volume settings)';freq=1",
"executor" : "shell://cmd=osascript -e 'set volume output volume %VAL%'",
"min": "0",
"max": "100",
"step": "5"
},