diff options
author | Todd Lyons <tlyons@exim.org> | 2012-07-19 08:59:08 -0700 |
---|---|---|
committer | Todd Lyons <tlyons@exim.org> | 2012-07-19 08:59:08 -0700 |
commit | 9471b034a78d53e4bfb951649e9f556cf4e6018c (patch) | |
tree | c9e2cfc927d5a8788b6c2f9355a95f5f1b0fc878 | |
parent | a543079f3c7a2ca09a90a9728a9726439f33eb60 (diff) |
Add example ACL usage of ${run in exim spec.
-rw-r--r-- | doc/doc-docbook/spec.xfpt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index c8ed79102..19fb321ea 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -9405,6 +9405,20 @@ can be the word &"fail"& (not in braces) to force expansion failure if the command does not succeed. If both strings are omitted, the result is contents of the standard output/error on success, and nothing on failure. +.vindex "&$run_in_acl$&" +The standard output/error of the command is put in the variable &$value$&. +In this ACL example, the output of a command is logged for the admin to +troubleshoot: +.code +warn condition = ${run{/usr/bin/id}{yes}{no}} + log_message = Output of id: $value +.endd +If the command requires shell idioms, such as the > redirect operator, the +shell must be invoked directly, such as with: +.code +${run{/bin/bash -c "/usr/bin/id >/tmp/id"}{yes}{yes}} +.endd + .vindex "&$runrc$&" The return code from the command is put in the variable &$runrc$&, and this remains set afterwards, so in a filter file you can do things like this: |