On Mon, 2002-11-18 at 15:00, Michael Lake wrote:
> Next step will be to get this netenv working so I get a dialog box up at
> boot time to select my networking environment.
> Its installed but is not being started upon boot. I have found its home
> page at netenv.sourceforge and will look at that.
Hit me with the cluestick if you figure it out.
In the end I wrote my own brute force script. See attached, GPL, all
care no responsibilty, yada yada.
To use it, just setup your /etc/network/interfaces for one location,
then copy it to /etc/local/switchto/<location_name>/interfaces. Do
similar for resolve.conf For each different setup, add a new
<location_name> directory (in /usr/local/switchto).
Then (as root)
# switchto home
will copy those 2 files from the /usr/local/switchto/home directory, and
restart your network.
Kludge, yep! Works, yep!
Steve
#!/bin/bash
# Switchto, a quick network switcher for working with Debian
if [ -z $1 ]
then
echo "Current Network is:"
cat /usr/local/switchto/status
else
if [ -d "/usr/local/switchto/$1" ]
then
echo "WooHoo!"
ifdown -a
cp -f "/usr/local/switchto/$1/interfaces" /etc/network/interfaces
cp -f "/usr/local/switchto/$1/resolv.conf" /etc/resolv.conf
ifup -a
echo "$1" > /usr/local/switchto/status
else
echo "Nope, wrong choice."
fi
fi