From owner-freebsd-jail@FreeBSD.ORG Sat Aug 2 17:37:54 2008 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60841065676; Sat, 2 Aug 2008 17:37:54 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 287DF8FC0A; Sat, 2 Aug 2008 17:37:53 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.2/8.14.2) with ESMTP id m72Hbkit096965; Sat, 2 Aug 2008 18:37:48 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.7.0 smtp.infracaninophile.co.uk m72Hbkit096965 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1217698668; bh=AC1ipECTabPf2S c1LtN8ycYRLzo77avwTk1j1OQDPQI=; h=Message-ID:Date:From:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Cc:Content-Type: Date:From:In-Reply-To:Message-ID:Mime-Version:References:To; z=Mes sage-ID:=20<48949B5F.4070300@infracaninophile.co.uk>|Date:=20Sat,=2 002=20Aug=202008=2018:37:35=20+0100|From:=20Matthew=20Seaman=20|Organization:=20Infracaninophile|User -Agent:=20Thunderbird=202.0.0.16=20(X11/20080726)|MIME-Version:=201 .0|To:=20Redd=20Vinylene=20|CC:=20questions @freebsd.org,=20freebsd-jail@freebsd.org|Subject:=20Re:=20jail_box_ ip=3D""|References:=20|In-Reply-To:= 20|X-E nigmail-Version:=200.95.6|X-Enigmail-Version:=200.95.6|Content-Type :=20multipart/signed=3B=20micalg=3Dpgp-sha256=3B=0D=0A=20protocol=3 D"application/pgp-signature"=3B=0D=0A=20boundary=3D"------------eni g9ECDFE44CF1717F897ADFB13"; b=xHHnfHjoG8pYyjM6Gq9m8rUUrdfcxiU75Ptn2 Af1BH9xdYpzw1ZyGC8heEk6Z7WzMB4VSh2O0JFW2559cJDbKvI8rpnImbDQhZEM8mL7 k+LigPnw9L64bzpqd1k/RdpP0s8KUEZeAvDQXdYPA/IgbnMOyJ6gQYqZMcMe/de5VCw = Message-ID: <48949B5F.4070300@infracaninophile.co.uk> Date: Sat, 02 Aug 2008 18:37:35 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.16 (X11/20080726) MIME-Version: 1.0 To: Redd Vinylene References: In-Reply-To: X-Enigmail-Version: 0.95.6 X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig9ECDFE44CF1717F897ADFB13" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Sat, 02 Aug 2008 18:37:48 +0100 (BST) X-Virus-Scanned: ClamAV 0.93.3/7915/Sat Aug 2 04:45:09 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-jail@freebsd.org, questions@freebsd.org Subject: Re: jail_box_ip="" X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2008 17:37:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9ECDFE44CF1717F897ADFB13 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable 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 line= > ever? >=20 > Like this? >=20 > jail_box_ip=3D"66.252.2.4,\ > 66.252.2.5,\ > 66.252.2.6,\ >=20 > Unfortunately that doesn't look too good. >=20 > Nor does: >=20 > 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/^,//); >=20 > 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=20 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 --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig9ECDFE44CF1717F897ADFB13 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkiUm2oACgkQ8Mjk52CukIxPfQCgicUz6ZnHAMgR6W6XLFcFlDdU NKQAn2U0jJauJIAvei1Bug3aQ95RcuPa =A+Wv -----END PGP SIGNATURE----- --------------enig9ECDFE44CF1717F897ADFB13--