[Sussex] Debian /etc/network/interfaces
Alan F
alan at slug.greenmeads.co.uk
Thu Apr 21 22:17:12 UTC 2005
Well this has totally left me out of ideas. I'm trying to work out the
mapping stuff in debian's /etc/network/interfaces. I have this simple
shellscript which returns the value of something ($1) which was
specified on the kernel boot line. The idea behind this is that I can
specify ath0=home or ath0=work at the boot line and debian will
configure my wireless settings accordingly.
#!/bin/sh
default=MANUAL
if [ ! "$1" ]; then
echo $default
exit 0
fi
param=`cat /proc/cmdline | sed 's/ /\n/g' | egrep "^$1($|=)" | sed "s/^$1=//" | tr [:lower:] [:upper:]`
echo $1 = $param >>/root/netparam.debug
if [ "$param" ]; then
echo $param
else
echo $default
fi
And here is my /etc/network/interfaces
auto lo ath0 eth0
mapping ath0
script /usr/local/sbin/netparam.sh
map HOME ath0-home
map WORK ath0-work
iface ath0-home inet dhcp
wireless-essid blah
wireless-key supersecret
iface ath0-work inet dhcp
wireless-essid blah
wireless-key supersecret
OK. Now notice the debug thingy I put in the script. When I run /etc/init.d/networking start, this is what's in it:
# cat /root/netparam.debug
ath0 = HOME
eth0 =
And on its own..
# /usr/local/sbin/netparam.sh ath0
HOME
So the script seems to be working fine. But for some reason, my wireless settings aren't being configured. :-\
Any ideas would be greatly appreciated before I go mad,
Alan
More information about the Sussex
mailing list