From: Ewan Mellor Subject: Re: network-bridge script reworked Date: Fri, 21 Oct 2005 14:48:09 +0100 Message-ID: <20051021134809.GA27120@leeni.uk.xensource.com> References: <20051019093502.GP8705@tpkurt.tagung.uni-hamburg.de> <20051020104100.GZ26910@leeni.uk.xensource.com> <20051020182220.GB13372@tpkurt.garloff.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20051020182220.GB13372@tpkurt.garloff.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Kurt Garloff List-Id: xen-devel@lists.xenproject.org On Thu, Oct 20, 2005 at 08:22:20PM +0200, Kurt Garloff wrote: > Hi Ewan, > > On Thu, Oct 20, 2005 at 11:41:00AM +0100, Ewan Mellor wrote: > > Kurt, this line > > > > eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- ${netdev}` > > > > looks a bit SuSE-specific to me. > > Right, I should have removed that hunk or at least do something like > test -e /etc/SuSE-release && eval `...` Is this a reasonable solution: if [ -e /etc/SuSE-release ] then ifup() { eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1` /sbin/ifup ${HWD_CONFIG_0} $1 } ifdown() { eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1` /sbin/ifdown ${HWD_CONFIG_0} $1 } In other words, override ifup and ifdown to do the right thing on SuSE. That way, in our scripts we can just write "ifup eth0". We already are doing this for Gentoo, so this would be my preferred solution, as it keeps all the distro-specific stuff out of the script bodies. My only doubt is that you use the eval before ifup and ifdown in op_start(), but not in op_stop(), and I wonder whether that is important. Ewan.