Namespaces

 
0.2.0-SNAPSHOT permalink Arrow_down_16x16

with-ssh-agent

clj-ssh.ssh

  • (with-ssh-agent [& agent] & body)
Bind an ssh-agent for use as identity manager.
The argument vector can be empty, in which case a new agent is created. If passed a String or File, then this is passed to the new agent as an identity to be added.
An existing agent instance can alternatively be passed.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clj_ssh/ssh.clj:202 top

(defmacro with-ssh-agent
  "Bind an ssh-agent for use as identity manager.
The argument vector can be empty, in which case a new agent is created.  If passed a String or File, then this is passed to the new agent as an identity to be added.
An existing agent instance can alternatively be passed."
  [[& agent] & body]
  `(binding [*ssh-agent*
             ~(if (seq agent)
                `(let [arg# ~(first agent)]
                   (if (ssh-agent? arg#)
                     arg#
                     (create-ssh-agent ~@agent)))
                `(create-ssh-agent))]
     ~@body))
Vars in clj-ssh.ssh/with-ssh-agent: agent defmacro first seq apply binding concat let list vector
Used in 0 other vars

Comments top

No comments for with-ssh-agent. Log in to add a comment.