]> Cypherpunks.ru repositories - nncp.git/blob - doc/cmd/nncp-exec.texi
Add various documentation indices
[nncp.git] / doc / cmd / nncp-exec.texi
1 @node nncp-exec
2 @pindex nncp-exec
3 @section nncp-exec
4
5 @example
6 $ nncp-exec [options] [-use-tmp] [-nocompress]      NODE HANDLE [ARG0 ARG1 @dots{}]
7 $ nncp-exec [options] [-use-tmp] [-nocompress] area:AREA HANDLE [ARG0 ARG1 @dots{}]
8 @end example
9
10 Send execution command to @option{NODE} for specified @option{HANDLE}.
11 Body is read from @code{stdin} into memory and compressed (unless
12 @option{-nocompress} is specified). After receiving, remote side will
13 execute specified @ref{CfgExec, handle} command with @option{ARG*}
14 appended and decompressed body fed to command's @code{stdin}.
15
16 For example, if remote side has following configuration file for your
17 node:
18
19 @verbatim
20 exec: {
21   sendmail: [/usr/sbin/sendmail, "-t"]
22   appender: ["/bin/sh", "-c", "cat >> /append"]
23 }
24 @end verbatim
25
26 @vindex NNCP_SELF
27 @vindex NNCP_SENDER
28 @vindex NNCP_NICE
29 then executing @verb{|echo My message | nncp-exec -replynice 123 REMOTE
30 sendmail root@localhost|} will lead to execution of:
31
32 @example
33 echo My message |
34     NNCP_SELF=REMOTE \
35     NNCP_SENDER=OurNodeId \
36     NNCP_NICE=123 \
37     /usr/sbin/sendmail -t root@@localhost
38 @end example
39
40 If @ref{CfgNotify, notification} is enabled on the remote side for exec
41 handles, then it will sent simple letter after successful command
42 execution with its output in message body.
43
44 @strong{Pay attention} that packet generated with this command won't be
45 be chunked.
46
47 If you use @option{area:AREA} instead of @option{NODE}, then
48 @ref{Multicast, multicast} packet will be sent to specified area. That
49 creates outgoing packet to the @strong{self} node, so you have to run
50 @ref{nncp-toss, tossing} to create outgoing packets to required subscribers.