Hello Alberto,

To solve the problem, here is what I have done.  I wrote a service called 
"netconfig" which runs before net.* and wlan.  The file is attached and is 
put in /etc/init.d.  I set it up to run using "rc-update add netconfig 
boot"...

If you look at the begining of the program, there is a list of configuration 
files that it changes based on an environment variable called NetConfig...

What is expected is that if NetConfig is set, then link the file-$NetConfig to 
file.  I use a hard link as it seemed to work better...

To set NetConfig, at the end of each "kernel" line in grub.conf, I have 
NetConfig=HWLAN, or whatever...

The only issue I am currently working on is that sometimes, when I go from a 
fixed IP to dhcp, the system remembers the fixed IP, I am not sure how it 
does it, but is has happened to me a few times.  Other than that, I currently 
have three main configurations; dhcp, fixed IP, and my home wireless...

Let me know if the program is helpful to you...

                         Sean

On August 7, 2003 01:25 pm, Alberto Bert wrote:
> Hi all,
>
> I'm using my laptop in two different networks, one use dhcp (dinamic
> auto IP) and the other normal static IP. Is there any way to set network
> parameters to select automaticaly the right network coinfiguration?
>
> Could you suggest a solution for this problem? I don't know so much in
> networking, so please be explicit ;-)
>
> up to now I'm doing something EXTREMELY stupid: I have 2 /etc/conf.d/net
> and I switch between them manually, then since I don't know how to
> restart the network with new parameters, I reboot :-(
> (/etc/init.d/net.eth0 stop and start doesn't work, I mean probably it's
> not enought)
>
> I'm sure there is something more clever.
>
> Any suggestion?
>
> Thank you in advance,
> alb
>
> --
> [EMAIL PROTECTED] mailing list

-- 
Sean Higgins, [EMAIL PROTECTED]
http://www.systura.com - "Where information meets knowledge."
#!/sbin/runscript
#
# netconfig
#
# Written by:  Sean C. Higgins
#

config_files="/etc/conf.d/net /etc/conf.d/wlan.conf /etc/conf.d/`hostname`.fw"

depend() {
        before net.* wlan
}

start() {
        ebegin "Starting netconfig"
        if [ -z "$NetConfig" ]
        then
                ebegin "  Default configuration"
                for i in $config_files
                do
                  ln -f $i-DEFAULT $i
                done
        else
                ebegin "  Switching to: $NetConfig"
                status=0
                for i in $config_files
                do
                  if [ -f $i-$NetConfig ]
                  then
                        tstatus=0
                        ln -f $i-$NetConfig $i || tstatus=1
                        if [ $tstatus -ne 0 ]
                        then
                          einfo "  ** $i-$NetConfig not found"
                          status=1
                        fi
                  else
                        ln -f $i-DEFAULT $i || status=1
                  fi
                done
        fi
        eend $status "File not found"
}

stop() {
        ebegin "Stopping netconfig"
        status=0
        for i in $config_file
        do
          tstatus=0
          rm $i || tstatus=1
          if [ $tstatus -ne 0 ]
          then
            echo "  ** Error removing $i"
            status=1
          fi
        done
        eend $status "Error removing files"
}

--
[EMAIL PROTECTED] mailing list

Reply via email to