Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncdispatch, ssh2, strutils
- proc main() {.async.} =
- var client = newSSHClient()
- defer: client.disconnect()
- await client.connect("server", "user", Port(22), password="pass")
- let x = await client.execCommand("date +\"%T.%N\"")
- echo x
- let y = await client.execCommand("date +\"%T.%N\"")
- echo y
- waitFor main()
Advertisement
Add Comment
Please, Sign In to add comment