From f3e158877154ff1d9067e72a6eb118295964fea1 Mon Sep 17 00:00:00 2001 From: Weisenhorn Geoffroy Date: Mon, 29 Sep 2008 19:11:52 +0200 Subject: Add NetBSD support --- woof | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/woof b/woof index 10ab18a..9bcc635 100755 --- a/woof +++ b/woof @@ -23,6 +23,7 @@ # Solaris support by Colin Marquardt, # FreeBSD support with the help from Andy Gimblett, # Cygwin support by Stefan Reichör +# NetBSD support by Geoffroy Weisenhorn, import sys, os, popen2, signal, select, socket, getopt, commands import urllib, BaseHTTPServer @@ -63,6 +64,10 @@ def find_ip (): netstat = commands.getoutput ("LC_MESSAGES=C netstat -arn") defiface = [i.split ()[-1] for i in netstat.split ('\n') if len(i) > 2 and i.split ()[0] == "0.0.0.0"] + elif platform == "NetBSD": + netstat = commands.getoutput ("LC_MESSAGES=C netstat -arn") + defiface = [i.split ()[-1] for i in netstat.split ('\n') + if len(i) > 2 and i.split ()[0] == "default"] else: print >>sys.stderr, "Unsupported platform; please add support for your platform in find_ip()."; return None @@ -73,7 +78,7 @@ def find_ip (): if platform == "Linux": ifcfg = commands.getoutput ("LC_MESSAGES=C ifconfig " + defiface[0]).split ("inet addr:") - elif platform in ("Darwin", "FreeBSD", "SunOS"): + elif platform in ("Darwin", "FreeBSD", "SunOS", "NetBSD"): ifcfg = commands.getoutput ("LC_MESSAGES=C ifconfig " + defiface[0]).split ("inet ") -- cgit v1.2.3