Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Python-Skript zum reconnecten eines samsung sl 3010
- # Usage: reconnect.py [host] [user] [password]
- import getpass
- import sys
- import telnetlib
- args = sys.argv
- if len(args)>1:
- HOST = args[1]
- else:
- HOST = "samsung.router"
- if len(args)>2:
- user = args[2]
- else:
- user = raw_input("Enter your remote account: ")
- if len(args)>3:
- password = args[3]
- else:
- password = getpass.getpass()
- port = 30023
- command = "/etc/init.d/daily_reconnect.sh 1"
- tn = telnetlib.Telnet(HOST, port)
- tn.read_until("amazon login: ")
- tn.write(user + "\n")
- tn.read_until("Password: ")
- tn.write(password + "\n")
- tn.write(command + "\n")
- tn.write("exit\n")
- print tn.read_all()
Add Comment
Please, Sign In to add comment