Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import telnetlib
- def reconnect():
- HOST = "fritz"
- user = "root"
- password = "geheim"
- tn = telnetlib.Telnet(HOST)
- tn.read_until("login: ")
- tn.write(user + "\n")
- tn.read_until("Password: ")
- tn.write(password + "\n")
- print "Killing dsld..."
- tn.write("dsld -s\n")
- tn.read_until("#")
- print "Restarting dsld..."
- tn.write("dsld -i -n\n")
- tn.read_until("#")
- tn.write("exit\n")
- tn.read_all()
- reconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement