From owner-freebsd-questions@FreeBSD.ORG Sat Aug 2 20:22: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 F0F45106566B for ; Sat, 2 Aug 2008 20:22:54 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.189]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC208FC17 for ; Sat, 2 Aug 2008 20:22:54 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so1189807mue.3 for ; Sat, 02 Aug 2008 13:22:53 -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=8sugP+tl6fVBCkVbDP65o4mqIj0lOrnVjTTcINtf8so=; b=Aa8VPWFeZtu08245R1rSZOhOsn2sXaoSbM/4bWyhHC3nHm697OnITmAlNUaoRI0OiF NS3OjwUNElTqVPnrCIeTLz+v5UyLCEfL66PeWB36n4vu+VLYbcuSsaBp4sR9mjtm47Z2 f/nO4MS5rYTJJ35FWz3TUENYpSIbRrX6bDbaA= 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=juh0vEU+XkvSxvus1mO/BwjtiUjMWqIOYsbLVnxvey0dq+GcF2wrXuCDVNNreW0+vl HRoBW+e1UPR0UVL7sf6KWNWerHW1b5fs54/GNE0+GTDCo/QhgDwSoWQuFuVMj7HDd5Y5 GRQO9aXqpDW6xUfA81mIrOJJ92l5FBr1yz3aM= Received: by 10.103.176.2 with SMTP id d2mr4794994mup.112.1217708573183; Sat, 02 Aug 2008 13:22:53 -0700 (PDT) Received: by 10.103.199.5 with HTTP; Sat, 2 Aug 2008 13:22:53 -0700 (PDT) Message-ID: Date: Sat, 2 Aug 2008 22:22:53 +0200 From: "Redd Vinylene" To: m.seaman@infracaninophile.co.uk In-Reply-To: <4894B274.7060308@adventuras.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <48949B5F.4070300@infracaninophile.co.uk> <4894B274.7060308@adventuras.no> Cc: freebsd-jail@freebsd.org, questions@freebsd.org Subject: Re: jail_box_ip="" 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 20:22:55 -0000 Actually: jail_box_ip=3D$( jot -w "66.252.2.%d" -s "," 124 4 ) gives me: Aug 2 20:10:50 mother root: /etc/rc: WARNING: devfs_set_ruleset: you must specify a ruleset number Aug 2 20:10:58 mother root: /etc/rc: ERROR: jail: No IP address has been defined for box On Sat, Aug 2, 2008 at 9:16 PM, Lars Kristiansen wrote: > Redd Vinylene skrev: >> >> Can something similar be used for my >> >> ifconfig_rl0_aliasN=3D"inet 66.252.2.N netmask 255.255.255.255" >> >> as well? >> > > This is not as elegant, but may help in a similar way: > > alia=3D-1; > while [ "$alia" -lt '123' ] ; do > alia=3D$(($alia+1)) ; > ips=3D$(($alia+4)) ; > echo "ifconfig_rl0_alias$alia=3D\"inet 66.252.2.$ips netmask > 255.255.255.255\"" ; > done > > > Regards > Lars, > arbeids=F8kende, Oslo > > >> On Sat, Aug 2, 2008 at 8:07 PM, Redd Vinylene >> wrote: >>> >>> jail_box_ip=3D$( jot -w "66.252.2.%d" -s "," 124 4 ) >>> >>> What a gorgeous solution ;) >>> >>> Thanks man! >>> >>> On Sat, Aug 2, 2008 at 7:37 PM, Matthew Seaman >>> wrote: >>>> >>>> Redd Vinylene wrote: >>>>> >>>>> Hey, I got a couple of hundred IPs, is there an easy way to add them >>>>> all to jail_box_ip=3D"ip1,ip2,ip3" without making like the longest li= ne >>>>> ever? >>>>> >>>>> Like this? >>>>> >>>>> jail_box_ip=3D"66.252.2.4,\ >>>>> 66.252.2.5,\ >>>>> 66.252.2.6,\ >>>>> >>>>> Unfortunately that doesn't look too good. >>>>> >>>>> Nor does: >>>>> >>>>> export x=3D$(cat ips);export jail_ips=3D''; for ip in $x; do export >>>>> jail_ips=3D"$jail_ips,$ip"; done; export jail_ips=3D$(echo $jail_ips = | sed >>>>> s/,$/''/ | sed s/^,//); >>>>> >>>>> Is there a more beautiful alternative? >>>> >>>> /etc/rc.conf is just /bin/sh code. All you need to do is set >>>> the variables -- usually by assigning a static string, but you >>>> can use whatever constructs you want. Well - within reason. Making >>>> something as critical as the system boot process depend on a bunch of >>>> other files or processes is not a good idea on the whole. >>>> >>>> You can include multi-line whitespace in the variables by using single >>>> quotes: >>>> >>>> jail_box_ip=3D'66.252.2.4, >>>> 66.252.2.5, >>>> 66.252.2.6, >>>> 66.252.2.7' >>>> >>>> Assuming that the init script that processes this data isn't phased >>>> by the inclusion of a bit of whitespace. >>>> >>>> Or you can generate the required numbers, assuming they are >>>> consecutive: >>>> >>>> jail_box_ip=3D$( jot -w "66.252.2.%d" -s "," 5 4 ) >>>> >>>> Cheers, >>>> >>>> Matthew >>>> >>>> -- >>>> Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard >>>> Flat 3 >>>> PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate >>>> Kent, CT11 9PW >>>> >>>> >>> >>> >>> -- >>> http://www.home.no/reddvinylene >>> >> >> >> > > --=20 http://www.home.no/reddvinylene