This binding integrates the possibility to execute arbitrary shell commands.
## Supported Things
Currently, the binding supports a single type of Thing, being the `command` Thing.
## Binding Configuration
For security reasons all commands need to be whitelisted.
Allowed commands need to be added to the `misc/exec.whitelist` file in the configuration directory.
Every command needs to be on a separate line.
Example:
```shell
/bin/echo "Hello world!"
/usr/local/bin/apcaccess status
php ./configurations/scripts/script.php %2$s
```
**Linux:**
Note that the commands are executed in the context and with the privileges of the process running the Java Virtual Machine.
On a Linux system the system user `openhab` needs to have the privileges needed to execute your intended command.
It is advised to test the correct operation of the command in the scope of the `openhab` user on the command line first:
```shell
sudo -u openhab <YOURCOMMAND>
```
It is not advised to run the virtual machine as superuser/root.
## Thing Configuration
The "command" Thing requires the command to execute on the shell.
Optionally one can specify:
-`transform` - A [transformation](https://www.openhab.org/docs/configuration/transformations.html) to apply on the execution result string.
-`interval` - An interval, in seconds, the command will be repeatedly executed. Default is 60 seconds, set to 0 to avoid automatic repetition.
-`timeout` - A time-out, in seconds, the execution of the command will time out, and lastly,
-`autorun` - A boolean parameter to make the command execute immediately every time the input channel is sent a different openHAB command. If choosing autorun, you may wish to also set `interval=0`. Note that sending the same command a second time will not trigger execution.
For each shell command, a separate Thing has to be defined.
The `command` itself can be enhanced using the well known syntax of the [Java formatter class syntax](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Formatter.html#syntax).
note - if you trigger execution using interval or the run channel, the `%2` substitution will use the most recent command (if there has been one) sent to the input channel. The state of the Item linked to input channel is ignored.