mirror of
https://github.com/hymkor/lispect.git
synced 2026-09-06 00:57:23 -04:00
example.lsp: use (wait PID)
This commit is contained in:
+9
-4
@@ -3,14 +3,16 @@
|
||||
(progn
|
||||
(format (error-output) "Usage: ~A ~A USERNAME@DOMAIN PASSWORD~%" $EXECUTABLE_NAME $PROGRAM_NAME)
|
||||
(return-from main nil)))
|
||||
(defglobal account (car args))
|
||||
(defglobal password (cadr args))
|
||||
|
||||
(let ((account (car args))
|
||||
(password (cadr args))
|
||||
(sshpid nil))
|
||||
|
||||
(with-handler
|
||||
(lambda (c)
|
||||
(format (error-output) "ssh is not found~%")
|
||||
(return-from main nil))
|
||||
(spawn "ssh" account))
|
||||
(setq sshpid (spawn "ssh" account)))
|
||||
|
||||
(expect*
|
||||
("[fingerprint])?"
|
||||
@@ -33,4 +35,7 @@
|
||||
("$ "))
|
||||
(sendln "echo YOU CAN CALL SOME COMMAND HERE")
|
||||
(expect "$ ")
|
||||
(sendln "exit"))
|
||||
(sendln "exit")
|
||||
(wait sshpid)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user