run a command when interface shows


Active Member

Reaction score: 1
Messages: 193

I use a 3g mobile modem and when I attach it I have a driver that automatically starts an interface called hso0.

I wonder if there is a simple way to make FreeBSD perform a certain command whenever network interface hso0 shows up? I would like it to run my connection program so I don't have to start it manually every time.



Reaction score: 549
Messages: 2,403

Not limited to network interfaces - works with all devices. Check out devd(8) and devd.conf(5) man pages. Basically, it can run commands (or scripts) on attach / detach of any device.