From owner-freebsd-questions@FreeBSD.ORG Sat Aug 2 19:59:55 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA1C1106566B for ; Sat, 2 Aug 2008 19:59:55 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.184]) by mx1.freebsd.org (Postfix) with ESMTP id 4540B8FC13 for ; Sat, 2 Aug 2008 19:59:54 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so1184854mue.3 for ; Sat, 02 Aug 2008 12:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=iQ6bVjtj9Oiq07MF7PMEKPhRWHJ+1KfAjFphGl2FvKg=; b=bVB5eM8lAPCNoSRYi4uoFGAsaaR6AIlnAw4MFxS7MvK/xOfYG+bOQxFQVTuu3xku+6 5AYAcz11IJjDb4eftnYVMQzD5rzYTok5zK0Nb9SaLv1lApAwRGpwURGeDaN+YZpfQUzI Cq1B0bTSPSEWx7XhFiOf2cEP96yZH1IUx81oE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Ujv2cIym1Mvbz/e8ECOyirJaBpvRZGplkN24hvUJPsIiyKrFjygudWeNlILxBTbXdl a5IOlcbZhRO5f7sxiHUoJKj22m0Cu86/P/+Jh0jMxEi+Nkvt8s2/8viQ4C8+lqydHFIe hmrAnP0XH71wVsRklOu33uMTM8Ekk3LBlaapM= Received: by 10.102.253.13 with SMTP id a13mr4794277mui.111.1217707193792; Sat, 02 Aug 2008 12:59:53 -0700 (PDT) Received: by 10.103.199.5 with HTTP; Sat, 2 Aug 2008 12:59:53 -0700 (PDT) Message-ID: Date: Sat, 2 Aug 2008 21:59:53 +0200 From: "Redd Vinylene" To: Polytropon In-Reply-To: <20080802212437.e5a853c1.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080802212437.e5a853c1.freebsd@edvax.de> Cc: questions@freebsd.org Subject: Re: Reducing 124 ifconfig lines in rc.conf to just 1 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2008 19:59:55 -0000 On Sat, Aug 2, 2008 at 9:24 PM, Polytropon wrote: > Hi! > > On Sat, 2 Aug 2008 21:11:47 +0200, "Redd Vinylene" wrote: >> Greetings! >> >> I got 124 ifconfig lines going from ifconfig_rl0_alias0="inet >> 80.252.2.3 netmask 255.255.255.255" to ifconfig_rl0_alias124="inet >> 80.252.2.127 netmask 255.255.255.255". >> >> Is it possible reducing it all to just 1 line using a for loop or jot >> or something? > > I'm thinking of a "two stage procedure" that can be implemented > well with /etc/rc.conf. Stupid idea, I know, but it should work, > allthough you could make it more tidy: > > # First create /etc/ifconfig.conf if not already there > if [ ! -f /etc/ifconfig.conf ]; then > echo "#!/bin/sh" > /etc/ifconfig.conf > ALIAS=0 > while [ ${ALIAS} -lt 125 ]; do > echo 'ifconfig_rl0_alias${ALIAS}="inet 80.252.2.`expr ${ALIAS} + 4` netmask 255.255.255.255" >> /etc/ifconfig.conf > ALIAS=`expr ${ALIAS} + 1` > done > fi > > # Now source it into /etc/rc.conf > . /etc/ifconfig.conf > > # Done. > > > -- > Polytropon > From Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... > That will probably work. Looks a bit messy though, I'll use it if nobody else knows of a simpler solution. Thanks! -- http://www.home.no/reddvinylene