ECMD Protocols

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche

ECMD via HTTP

If enabled in the configuration, you can call ECMD commands using URLs of the form:

http://ETHERSEX-IP/ecmd?ECMD-COMMAND

Depending on your browser, ECMD-COMMAND may need to have the spaces replaced by + signs. E.g.

http://ETHERSEX-IP/ecmd?show+version

ECMD via TCP

If enabled in the configuation Ethersex accepts ECMD commands via TCP. The default port that Ethersex listens on is 2701, but it can be changed in the configuration.

As a special Feature ECMD via TCP allows prefixing commands with ! (exclamation mark). This prefix forces the TCP connection to close directly after the command was processed.

Using this command you can easily integrate ECMD into Unix shell scripts. E.g. to get the current timestamp on your Ethersex as a variable in your shell, simply write

ECMD_DATE=`echo '!date' | nc ETHERSEX-IP ECMD-PORT`

Of course you need to change ETHERSEX-IP and ECMD-PORT by the values for your Ethersex.