Example of 'brilliant' apps?
Jason M. Leonard
fuzz at ldc.upenn.edu
Sun Mar 20 09:26:59 PST 2005
On Sun, 20 Mar 2005, Martin P. Hellwig wrote:
Gabriel Ambuehl wrote:
<cut>
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
think.
I was thinking something quick and dirty like so (note that this is
thoroughly untested here in Powerbook land):
#!/usr/local/bin/bash
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
/etc/netstart
if [ ping -oc1 google.com > /dev/null 2>&1 ]; then
echo "Successfully configured network using \
gateway $GATEWAY"
exit 0
fi
done
mv /etc/rc.conf.start /etc/rc.conf
mv /etc/resolv.conf.start /etc/resolv.conf
/etc/netstart
:Fuzz
More information about the Users
mailing list