Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Oct 2000 06:10:03 -0700 (PDT)
From:      Ruslan Ermilov <ru@sunbay.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: conf/21695: ifconfig_XXX_aliasY in rc.conf; Y must be in sequential order
Message-ID:  <200010021310.GAA95739@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/21695; it has been noted by GNATS.

From: Ruslan Ermilov <ru@sunbay.com>
To: Pekka Savola <pekkas@netcore.fi>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/21695: ifconfig_XXX_aliasY in rc.conf; Y must be in sequential order
Date: Mon, 2 Oct 2000 16:01:12 +0300

 On Mon, Oct 02, 2000 at 04:30:03AM -0700, Pekka Savola wrote:
 [...]
 >  > Hmm, how would you expect it to work?  rc.network scanning all possible
 >  > ifconfig_<iface>_alias<n>, where n is from 0 to infinity?  I doubt this
 >  > would be practical.
 >  
 >  Well, this is a bit hackish approach, but an equivalent of:
 >  
 >  grep ^ifconfig_.*_alias /etc/rc.conf
 >  
 >  would probably be good.
 >  
 Not if /usr/bin/grep is called when /usr is not yet mounted.
 
 If you really need to have the ability to selectively turn on/off
 aliases on your interface, the below might work.  Besides that it
 would allow you to selectively turn your aliases, it also has a
 plus in that you may choose whatever name you wish for your alias
 (much like the same as we do for ${static_routes}).
 
 #!/bin/sh
 
 network_interfaces="ed0"
 ifconfig_ed0_aliases="foo bar"
 ifconfig_ed0_alias_foo="alias_foo"
 ifconfig_ed0_alias_bar="alias_bar"
 
 for ifn in ${network_interfaces}; do
 	eval ifconfig_aliases=\$ifconfig_${ifn}_aliases
 	if [ -n "${ifconfig_aliases}" ]; then
 		for i in ${ifconfig_aliases}; do
 			eval ifconfig_args=\$ifconfig_${ifn}_alias_${i}
 			if [ -n "${ifconfig_args}" ]; then
 				echo ifconfig ${ifn} ${ifconfig_args} alias
 				eval showstat_$ifn=1
 			fi
 		done
 	fi
 done
 
 
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010021310.GAA95739>