Moved from ifconfig to ip

This commit is contained in:
Sebastian Lohff 2012-03-18 01:35:12 +01:00
parent 77be4adcd0
commit 48318d9132
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ def main():
server.address_family = 10 server.address_family = 10
# print urls with local network adresses # print urls with local network adresses
print "Some addresses this file will be available under:" print "Some addresses this file will be available under:"
ips = commands.getoutput(r"/sbin/ifconfig |grep 'inet6\?'|grep -v 127.0.0.1|grep -v ' fe80'|grep -v ::1|sed -n 's/.*inet6\?[a-zA-Z: -]\+\([0-9a-fA-F.:]*\).*/\1/p'") ips = commands.getoutput(r"/bin/ip addr|sed -n -e 's/.*inet6\? \([0-9.a-fA-F:]\+\)\/.*/\1/ p'|grep -v '^fe80\|^127.0.0.1\|^::1'")
for ip in ips.split("\n"): for ip in ips.split("\n"):
if ip.find(":") >= 0: if ip.find(":") >= 0:
# ipv6 # ipv6