1 Remote Shells
(require remote-shell/ssh) | package: remote-shell-lib |
procedure
(remote #:host host [ #:user user #:env env #:remote-tunnels remote-tunnels #:timeout timeout-secs]) → remote? host : string? user : string? = "" env : (listof (cons/c string? string?)) = '()
remote-tunnels :
(listof (cons/c (integer-in 1 65535) (integer-in 1 65535))) = null timeout-secs : real? = 600
The env argument specifies environment variables to set before running any command on the remote host.
The remote-tunnels argument specifies ports to tunnel from the remote host back to the local host. The first port number in each pair is the port number on the remote host, and the second port number is the port that it tunnels to on the local host.
The timeout argument specifies a timeout after which a remote command will be considered failed.
procedure
(ssh remote command [ #:mode mode #:failure-log failure-dest #:success-log success-dest #:show-time? show-time?]) → (or/c void? boolean? (cons/c boolean? bytes?)) remote : remote? command : (or/c string? path-string?) mode : (or/c 'error 'result 'output) = 'error failure-dest : (or/c #f path-string?) = #f success-dest : (or/c #f path-string?) = #f show-time? : any/c = #f
If mode is 'error, then the result is (void) or an exception is raised if the remote command fails with an connection error, an error exit code, or by timing out. If mode is 'result, then the result is #t for success or #f for failure. If mode is 'cons, then the result is a pair containing whether the command succeeded and a byte string for the command’s output (including error output).
If failure-dest is not #f, then if the command fails, the remote output (including error output) is recorded to the specified file. If success-dest is not #f, then if the command fails, the remote output (including error output) is recorded to the specified file.
procedure
(scp remote source dest [#:mode mode]) → (or/c void? boolean?)
remote : remote? source : path-string? dest : path-string? mode : (or/c 'error 'result 'output) = 'error
If mode is 'error, then the result is (void) or an exception is raised if the remote command fails. If mode is 'result, then the result is #t for success or #f for failure.
procedure
remote : remote? path : path-string?
procedure
(make-sure-remote-is-ready remote [ #:tries tries]) → void? remote : remote? tries : exact-nonnegative-integer? = 3