[Bio] / FigKernelPackages / FIG.py Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Thu Feb 12 16:00:31 2004 UTC revision 1.3, Mon Feb 23 17:18:19 2004 UTC
# Line 13  Line 13 
13      #      #
14    
15      hostname = socket.getfqdn()      hostname = socket.getfqdn()
16      hostname = "yips"  
17        #
18        # See if hostname is something.local., which is what
19        # a Mac will return if it didn't get a name via some
20        # other mechanism (DHCP or static config). We have to
21        # check here because otherwise it will pass the fqdn and
22        # local binding test.
23        #
24    
25        if not hostname.endswith(".local."):
26    
27      #      #
28      # First check that hostname is a fqdn, and that we can bind to it.      # First check that hostname is a fqdn, and that we can bind to it.
29      #      #
# Line 131  Line 141 
141      for l in fh:      for l in fh:
142          cols = l.strip().split()          cols = l.strip().split()
143    
144          if cols[0] == "default" or cols[0] == "0.0.0.0":          if len(cols) > 0 and (cols[0] == "default" or cols[0] == "0.0.0.0"):
145              interface_name = cols[-1]              interface_name = cols[-1]
146              break              break
147    
148      fh.close()      fh.close()
149    
150      print "Default route on ", interface_name      # print "Default route on ", interface_name
151    
152      #      #
153      # Find ifconfig.      # Find ifconfig.
# Line 157  Line 167 
167          print >> sys.stderr, "Ifconfig not found"          print >> sys.stderr, "Ifconfig not found"
168          return "localhost"          return "localhost"
169    
170      print >> sys.stderr, "found ifconfig ", ifconfig      # print >> sys.stderr, "found ifconfig ", ifconfig
171    
172      try:      try:
173          fh = os.popen(ifconfig+ " " + interface_name, "r")          fh = os.popen(ifconfig+ " " + interface_name, "r")

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3