ECMD Protocols: Unterschied zwischen den Versionen

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche
(ECMD Protocols: neu)
 
(fill with contents)
Zeile 1: Zeile 1:
ECMD Protocols
+
== ECMD via HTTP ==
 +
If enabled in the configuration, you can call ECMD commands using URLs of the form:
 +
<pre>http://ETHERSEX-IP/ecmd?ECMD-COMMAND</pre>
 +
Depending on your browser, ECMD-COMMAND may need to have the spaces replaced by '''+''' signs.
 +
E.g.
 +
<pre>http://ETHERSEX-IP/ecmd?show+version</pre>
 +
 
 +
== 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
 +
<pre>ECMD_DATE=`echo '!date' | nc ETHERSEX-IP ECMD-PORT`</pre>
 +
Of couse you need to change ETHERSEX-IP and ECMD-PORT by the values for your Ethersex.
 +
 
 +
[[Category:Ethersex]]

Version vom 19. Mai 2009, 12:09 Uhr

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 couse you need to change ETHERSEX-IP and ECMD-PORT by the values for your Ethersex.