diff --git a/examples/hwintf.py b/examples/hwintf.py index b376538..bbcff34 100755 --- a/examples/hwintf.py +++ b/examples/hwintf.py @@ -17,10 +17,11 @@ from mininet.util import quietRun def checkIntf( intf ): "Make sure intf exists and is not configured." - if ( ' %s:' % intf ) not in quietRun( 'ip link show' ): + config = quietRun( 'ifconfig %s 2>/dev/null' % intf, shell=True ) + if not config: error( 'Error:', intf, 'does not exist!\n' ) exit( 1 ) - ips = re.findall( r'\d+\.\d+\.\d+\.\d+', quietRun( 'ifconfig ' + intf ) ) + ips = re.findall( r'\d+\.\d+\.\d+\.\d+', config ) if ips: error( 'Error:', intf, 'has an IP address,' 'and is probably in use!\n' )