mirror of
https://github.com/koush/scrypted.git
synced 2026-05-05 22:00:27 +01:00
13 lines
326 B
Python
13 lines
326 B
Python
if __name__ == "__main__":
|
|
import telnetlib
|
|
import sys
|
|
import signal
|
|
|
|
host = sys.argv[1]
|
|
port = int(sys.argv[2])
|
|
|
|
with telnetlib.Telnet(host, port) as tn:
|
|
def sigint_handler(signum, frame):
|
|
tn.write(b"\x03")
|
|
signal.signal(signal.SIGINT, sigint_handler)
|
|
tn.interact() |