Skip to main content

Thread: [Python] Checking if ubuntu is connected to *given* wireless network


hey guys,

working on script logs schools hotspot when connects. have http-request done, pretty easy how check if ubuntu connected aau-ins wireless network?

here code far(just http request):
code:
#! /usr/bin/python    import urllib  import urllib2  import sys  import cookielib  import hashlib    #accept cookies browse telmore website  cookiejar = cookielib.lwpcookiejar()  opener = urllib2.build_opener(urllib2.httpcookieprocessor(cookiejar))    #add headers  opener.addheaders = [('user-agent', "mozilla/5.0")]    #accept arguments username , password  username = sys.argv[1]  password = sys.argv[2]    #url request  url = "https://hotspot.tnb.aau.dk/nwa_auth/action/smb"    #fill forms username , password arguments  form = { "auth_smb_user" : username,           "auth_smb_pass" : password }    #encode form , create request           encodedform = urllib.urlencode(form)  request = urllib2.request(url, encodedform)  page = opener.open(request)  contents = page.read()

thanks,

dane

code:
iwconfig wlan0 | grep -o aau-ins


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [Python] Checking if ubuntu is connected to *given* wireless network


Ubuntu

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support