Advertisement
Guest User

Untitled

a guest
May 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. import telnetlib
  2.  
  3. def reconnect():
  4.     HOST = "fritz"
  5.     user = "root"
  6.     password = "geheim"
  7.     tn = telnetlib.Telnet(HOST)
  8.     tn.read_until("login: ")
  9.     tn.write(user + "\n")
  10.     tn.read_until("Password: ")
  11.     tn.write(password + "\n")
  12.     print "Killing dsld..."
  13.     tn.write("dsld -s\n")
  14.     tn.read_until("#")
  15.     print "Restarting dsld..."
  16.     tn.write("dsld -i -n\n")
  17.     tn.read_until("#")
  18.     tn.write("exit\n")
  19.     tn.read_all()
  20.  
  21. reconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement