#!/usr/bin/python2.3
'''this script connects to the Netgear WG614 router 
   and restarts the Router due to WLAN instability
'''
import pexpect

child = pexpect.spawn("telnet 192.168.3.254 80")

child.expect(r"is")
child.sendline(r"""POST /upnp.cgi HTTP/1.1
Host: 192.168.3.254
Content-type: application/x-www-form-urlencoded
Content-length: 77
Authorization: Basic YWRtaW46bGZzbGludXg=

AdverTime=30&TimeToLive=4&submit=Apply&hiddenAdverTime=30&hiddenTimeToLive=4

.

""")




child.expect(pexpect.EOF)

print child.before
