summaryrefslogtreecommitdiff
path: root/modules/ssh/shell.scm
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-12-13 23:50:57 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-12-13 23:50:57 +0300
commit3687c3c69da9394c795c6bda3ae3f9a3421315a5 (patch)
tree03684f9bc644238c035c6042e3a5ee560d398766 /modules/ssh/shell.scm
parentshell.scm: New module (diff)
downloadguile-ssh-3687c3c69da9394c795c6bda3ae3f9a3421315a5.tar.gz
shell.scm (command-available?): New procedure
* modules/ssh/shell.scm (command-available?): New procedure. * modules/ssh/dist/node.scm (node-server-running?): Use it.
Diffstat (limited to 'modules/ssh/shell.scm')
-rw-r--r--modules/ssh/shell.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/ssh/shell.scm b/modules/ssh/shell.scm
index 2b108ea..c36303d 100644
--- a/modules/ssh/shell.scm
+++ b/modules/ssh/shell.scm
@@ -39,7 +39,7 @@
#:use-module (ice-9 rdelim)
#:use-module (ssh channel)
#:use-module (ssh popen)
- #:export (rexec which pgrep fallback-pgrep))
+ #:export (rexec which pgrep fallback-pgrep command-available?))
;;;
@@ -105,4 +105,10 @@ Return two values: a check result and a return code."
"exit 1;"
"' | bash"))))
+(define (command-available? session command)
+ "check if COMMAND is available on a remote side."
+ (receive (result rc)
+ (which session command)
+ (zero? rc)))
+
;;; shell.scm ends here.