Whoo, ephemera used my alterations to the netstat code.
EDIT: While you're not likely to run into this yet, consider changing the size of the interface variable to IFNAMSIZ.
EDIT2: You're using OpenBSD, also consider using strlcpy/strlcat instead of strncpy/strncat..
EDIT3: I'm nagging now, ignore me.. -pedantic, anyway, consider making this daemon privsep, there shouldn't be a need to run this as root.