def checkIntf(intf):
 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('\\d+\\.\\d+\\.\\d+\\.\\d+', config)
 if ips:
  error('Error:', intf, 'has an IP address,and is probably in use!\n')
  exit(1)

def checkIntf ( intf ) : 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 ( '\\d+\\.\\d+\\.\\d+\\.\\d+' , config ) if ips : error ( 'Error:' , intf , 'has an IP address,and is probably in use!\n' ) exit ( 1 )
make sure intf exists and is not configured .