Add project files
This commit is contained in:
parent
5849bd98b4
commit
4f8419fb51
4 changed files with 162 additions and 1 deletions
21
agent_example.py
Executable file
21
agent_example.py
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import agent
|
||||
from pathlib import Path
|
||||
|
||||
agent.VERSION = 1
|
||||
|
||||
def echo(t: agent.Task):
|
||||
agent.writer_queue.put(f"{t.user}: {t.args}")
|
||||
|
||||
agent.commands.update({
|
||||
"echo": echo
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
agent.main(
|
||||
server_host= "localhost",
|
||||
server_port = 8022,
|
||||
user = "example1",
|
||||
key = Path("../ex1"),
|
||||
known_hosts = Path("../known"))
|
Reference in a new issue