ECMD Protocols: Unterschied zwischen den Versionen

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche
(fill with contents)
K
Zeile 16: Zeile 16:
 
timestamp on your Ethersex as a variable in your shell, simply write
 
timestamp on your Ethersex as a variable in your shell, simply write
 
<pre>ECMD_DATE=`echo '!date' | nc ETHERSEX-IP ECMD-PORT`</pre>
 
<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.
+
Of course you need to change ETHERSEX-IP and ECMD-PORT by the values for your Ethersex.
  
 
[[Category:Ethersex]]
 
[[Category:Ethersex]]

Version vom 19. Mai 2009, 13:28 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 course you need to change ETHERSEX-IP and ECMD-PORT by the values for your Ethersex.