I was getting tired of having my machine not DHCP on the ethernet when I boot. I have eth0's auto up disabled because it's usually not connected to a network when it boots. But sometimes it is, and logging in on a shell and ifup'ing it was getting old. So I came up with a cheap trick.
(I'd use the daemons that detect link beat and bring the interface up and down based on it, but for much of what I do, that's unsuitable for various reasons as well, so I just want to assume that the interface should only act automatically if it's plugged into a network on boot.)
(in /etc/network/interfaces)
auto eth0 iface eth0 inet dhcp pre-up /sbin/mii-tool eth0|grep ok > /dev/null
This takes the output of mii-tool's report on eth0. Since grep returns an error code if the string is not found (mii-tool reports "eth0: no link" if not connected, and "eth0: negotiated 100baseTx-FD, link ok" (or similar) when it's connected), the interface going up will fail if mii-tool doesn't have an "ok" in the return. So if it's not connected on boot, it won't go up automatically, but if it is, it'll DHCP it on boot.
It's something quasi-obvious but neat.
And to all my friends back in MI, I just want to point out that I have only been wearing a coat during the evenings. 😛
And to all my friends back in MI, I just want to point out that I have only been wearing a coat during the evenings. 😛
sucks to be you…I haven't even been wearing one at night 😛
oh, and in case you didn't see it in my journal, Wine failed to even install Streets and Trips. I'm gonna try running WinMX under it later, as according to Wine's website, WinMX is fully supported…just to make sure I'm not doing something wrong.
Yea, I wouldn't count on a Microsoft product to work in Wine. They all but intentionally break them so they don't.
WinMX works beautifully…unfortunetly neither of my laptop drives are any good. Oh well, maybe I can find a deal on eBay….
perhaps. The new stuff is coming down in price lately, so who knows, you might get lucky.
awesome idea, i'll make use of that on my notebook 🙂
Testing my procmail