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

Re: hotplug and ifup



A simpler way to accomplish the same thing is:

    mapping hotplug
        script /bin/grep
        map eth0
        map eth2

where the map lines list the physical interfaces to be ifupped
by hotplug.

--
Thomas Hood


At Mon, 3 Mar 2003 16:43:35 +1000, Anthony Towns wrote:
> Wow, that's dodgy. "ifup eth0=hotplug" sets the physical interface
> to eth0 and the logical interface to "hotplug", then runs the mapping
> scripts in the usual manner. Doing:
> 
> 	mapping hotplug
> 		script /usr/lib/hotplug/deal-with-hotplug-devs.sh
> 		map eth0 eth0
> 
> as the first thing in your /e/n/interfaces, and:
> 
> 	$ cat /usr/lib/hotplug/deal-with-hotplug-devs.sh
> 	#!/bin/sh
> 
> 	if="$1"
> 	out=""
> 	while read phys log; do
> 		if [ "$phys" = "$if" ]; then out="$log"; fi
> 	done
> 	if [ "" = "$out" ]; then
> 		exit 1
> 	else
> 		echo "$out"
> 		exit 0
> 	fi
> 
> then eth0 will be treated normally when hotplugged, and other devices will
> fail when hotplugged (because there's no "iface hotplug ..." line for them
> to be configured as).


-- 
Thomas Hood <jdthood0@yahoo.co.uk>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



Reply to: