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