java.lang.Object
org.openhab.core.model.script.actions.Exec

public class Exec extends Object
This class provides static methods that can be used in automation rules for executing commands on command line.
Author:
Pauli Anttila
  • Constructor Details

    • Exec

      public Exec()
  • Method Details

    • executeCommandLine

      public static void executeCommandLine(String... commandLine)

      Executes commandLine.

      A possible IOException gets logged but no further processing is done.

      Parameters:
      commandLine - the command line to execute
    • executeCommandLine

      public static String executeCommandLine(Duration timeout, String... commandLine)

      Executes commandLine.

      A possible IOException gets logged but no further processing is done.

      Parameters:
      timeout - timeout for execution, if null will wait indefinitely
      commandLine - the command line to execute
      Returns:
      response data from executed command line