From imattsson at common-lisp.net Fri Sep 4 18:51:42 2009 From: imattsson at common-lisp.net (imattsson) Date: Fri, 04 Sep 2009 14:51:42 -0400 Subject: [noctool-cvs] CVS source Message-ID: Update of /project/noctool/cvsroot/source In directory cl-net:/tmp/cvs-serv18971 Modified Files: utils.lisp Log Message: IM Added a function that almost (though alas not quite) mimics run-ssh-command and friends, but using the noctool-ssh libssh2 wrapper. --- /project/noctool/cvsroot/source/utils.lisp 2009/02/17 17:48:20 1.14 +++ /project/noctool/cvsroot/source/utils.lisp 2009/09/04 18:51:42 1.15 @@ -61,6 +61,13 @@ ,command))) (run-command command))) +(defun make-ssh-lib-command (command host &key (user "none") (port 22) password) + (let ((session (noctool-ssh:ssh-connect host user :port port :password password))) + (noctool-ssh:make-channel session :command command) + (let ((string (noctool-ssh:ssh-read session))) + (noctool-ssh:ssh-close session) + (make-string-input-stream string)))) + (defun ping-helper (key string) (let ((start (search key string))) (when start From imattsson at common-lisp.net Thu Sep 17 15:01:47 2009 From: imattsson at common-lisp.net (imattsson) Date: Thu, 17 Sep 2009 11:01:47 -0400 Subject: [noctool-cvs] CVS source Message-ID: Update of /project/noctool/cvsroot/source In directory cl-net:/tmp/cvs-serv29954 Modified Files: utils.lisp Log Message: IM Ooops, need to return a list on in/output streams from MAKE-SSH-LIB-COMMAND, to make it easier to replace make-ssh-command (as that is what run-command returns). --- /project/noctool/cvsroot/source/utils.lisp 2009/09/04 18:51:42 1.15 +++ /project/noctool/cvsroot/source/utils.lisp 2009/09/17 15:01:47 1.16 @@ -66,7 +66,8 @@ (noctool-ssh:make-channel session :command command) (let ((string (noctool-ssh:ssh-read session))) (noctool-ssh:ssh-close session) - (make-string-input-stream string)))) + (let ((stream (make-string-input-stream string))) + (list stream stream))))) (defun ping-helper (key string) (let ((start (search key string)))