Update telnet.py

This commit is contained in:
Elmon11 2020-12-02 22:45:40 +01:00 committed by GitHub
parent d320148612
commit 2d2bde604d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ class telnet:
self.port = port
self.username = username
self.password = password
def connect(self, *username):
self.session = Telnet(self.ip, self.port)
for x in username:
@ -16,7 +16,7 @@ class telnet:
if b'Username:' in self.session.read_until(b'Username:', timeout = 3):
time.sleep(0.5)
self.session.write(bytes(self.username, 'ascii') + b"\r\n")
self.session.write(bytes(self.username, 'ascii') + b"\r\n")
if b'Password:' in self.session.read_until(b'Password:', timeout = 3):
time.sleep(0.5)
self.session.write(bytes(self.password, 'ascii') + b"\r\n")