DragonFly users List (threaded) for 2005-03
Re: Example of 'brilliant' apps?
On Sun, 20 Mar 2005, Martin P. Hellwig wrote:
Gabriel Ambuehl wrote:
It would seem like an awfully hard thing to reliably detect what network
your on for all but the very simplest networks, no? Partner MAC will rarely
be the same all the time in complex networks (especially when they use
multiple AP to cover wide ranges with WiFi), IP often are private ones, so
not really useful either...
Well the combination of the gateways IP & full dns name should be enough I
I was thinking something quick and dirty like so (note that this is
thoroughly untested here in Powerbook land):
GATEWAYS="list of known default gateway IP addresses"
cp /etc/rc.conf /etc/rc.conf.start
cp /etc/resolv.conf /etc/resolv.conf.start
for GATEWAY in $GATEWAYS; do
cp /etc/rc.conf /etc/rc.conf.last
cp /etc/rc.conf.$GATEWAY /etc/rc.conf
cp /etc/resolv.conf /etc/resolv.conf.last
cp /etc/resolv.conf.$GATEWAY /etc/resolv.conf
if [ ping -oc1 google.com > /dev/null 2>&1 ]; then
echo "Successfully configured network using \
mv /etc/rc.conf.start /etc/rc.conf
mv /etc/resolv.conf.start /etc/resolv.conf