Beispiel #1
0
	def _checkConnection(self):
		ips = getInterfaceIp('tun0')
		if ips is None or len(ips) == 0:
			return False
		ipso = self.dbAuth.select(['ip'], 'addr')
		print 'ip:\n{%s} = {%s}' % (repr(ips), repr(ipso))
		ip = getMyIp()
		return (ip != ipso[0], ip)
Beispiel #2
0
def initIp(db):
	ip = getMyIp()
	db.processQueries([('INSERT INTO addr (ip) VALUES (:ip)', {':ip': ip})])