[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Starting up network interfaces conditionally



When I'm AC-plugged, I like my /etc/init.d/network script to start my wifi
card automatically.  But when I'm on battery, I'd rather not start it
automatically (I can always start it manually if I really want it).

Does anybody have an idea how to do that?
Can the `auto' lines in /etc/network/interfaces be parameterized by a little
script that says whether or not to auto-config the interface at boot?

The best solution I've found so far is to setup an alternative run-level
where the network is simply not configured.  Other than its complexity, one
problem with this solution is that powersaved doesn't obey it: I need
powersaved to stop/restart network services when suspending, so when the
machine wakes up powersaved blindly "re"starts the network services even if
I'm running in runlevel 3 where the network is supposedly not enabled.


        Stefan



Reply to: