Advertisement
ionutHulub

Modem stuff

Mar 9th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import urllib
  2. import urllib2
  3.  
  4. try:
  5.     #restart the modem
  6.     data = {'RestoreFactoryDefault' : '0',
  7.             'ResetReq' : '1'}      
  8.     data = urllib.urlencode(data)
  9.     req = urllib2.Request('http://192.168.100.1/goform/RgConfig', data)
  10.     urllib2.urlopen(req)
  11.  
  12.     #restore factory defaults
  13.     urllib2.urlopen('http://192.168.1.1/apply.cgi?submit_button=Factory_Defaults&change_action=&action=Restore&wait_time=19&FactoryDefaults=1')
  14. except Exception, e:
  15.     print '>> Fatal error: %s' % e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement