/etc/pccard_ether && assigning IP and routing

Matthias Apitz guru at unixarea.de
Thu Jun 18 06:05:49 UTC 2015


I own an Ubuntu phone BQ E4.5 and when I attach this on USB to my
FreeBSD netbook the devd(8) launches

/etc/pccard_ether ue0 start

which works fine and the interface ue0 comes UP. I'd like to run an
additional script to assign IP via dhcclient, establish a default
route and restart sendmail. I do this manually as root with a script:

# change routing (...) to the Ubuntu phone BQ Aqaris E4.5

ifconfig ue0 || {
    printf "interface ue0 not found -- exit.\n"
    exit 1

ifconfig wlan0 down
route delete default

killall dhclient
rm -f /etc/resolv.conf
dhclient ue0

/etc/rc.d/sendmail stop
sleep 3
/etc/rc.d/sendmail start

I found no way with devd(8) hooks to run this script when interface ue0
comes up. Any ideas? Thanks in advance.

Matthias Apitz, guru at unixarea.de, http://www.unixarea.de/ +49-170-4527211    +49-176-38902045
"Wenn der Mensch von den Umständen gebildet wird, so muß man die Umstände menschlich bilden."
"Si el hombre es formado por las circunstancias entonces es necesario formar humanamente
las circunstancias", Karl Marx in Die heilige Familie / La sagrada familia (MEW 2, 138)

More information about the freebsd-questions mailing list