<reponame>nsgorlew/ethereum-docker
import os

def getIPs():
	#get list of ips connected at the specified port
	os.system("netstat -tn 2>/dev/null | grep :30303 | awk '{print $5}' | cut -d: -f1 | sort | sort -nr | head > iplist.txt")
	#put iplist into a list for parsing
	with open('iplist.txt') as f:
		ips = [line.rstrip() for line in f]
	iplist_clean = []
	for i in ips:
		if i not in iplist_clean:
			iplist_clean.append(i)
	return iplist_clean



import os

def getIPs():
	#get list of ips connected at the specified port
	os.system("netstat -tn 2>/dev/null | grep :30303 | awk '{print $5}' | cut -d: -f1 | sort | sort -nr | head > iplist.txt")
	#put iplist into a list for parsing
	with open('iplist.txt') as f:
		ips = [line.rstrip() for line in f]
	iplist_clean = []
	for i in ips:
		if i not in iplist_clean:
			iplist_clean.append(i)
	return iplist_clean
#get list of ips connected at the specified port #put iplist into a list for parsing