From owner-freebsd-questions@FreeBSD.ORG Tue Aug 18 10:24:50 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D13661065691 for ; Tue, 18 Aug 2009 10:24:50 +0000 (UTC) (envelope-from artis.caune@gmail.com) Received: from mail-bw0-f219.google.com (mail-bw0-f219.google.com [209.85.218.219]) by mx1.freebsd.org (Postfix) with ESMTP id 5C1718FC16 for ; Tue, 18 Aug 2009 10:24:49 +0000 (UTC) Received: by bwz19 with SMTP id 19so3884182bwz.37 for ; Tue, 18 Aug 2009 03:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=GB0ObckbjBKrKL/0nNVpVIqA568s7MJMgQDkKtAmsk8=; b=YiEgXDd61knCxnWhl0eI/bWxSQ+lyTeAoLGdiRCh8UCaJ0gOwL5QHgSZexiCpI+ccX 7agLwlN9QhqqNHj9UjJ98yku3LJV1h5WQBFVNwmLStKzFoDMsK19+WhOKLXVZps1IDys PMRBXSaAcV+gw9ljHq91u2uaMW9oLbZuEdYIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=LusTAfb5ADJONlIUSknx4GEyYzZIpKl0C5xGFiFtmzIztVUMeQnyBOjb8+TGwsNtkj Pf4nAOUBjgxMS4gDNFvEI6o1XJYxn0q9CDzdL+6sXLoADVvDJpFwA+mofrdnqj6PsEXp JStAZOHsejtxsvK+xuBTSNtwz1LPrlu0g+I+o= MIME-Version: 1.0 Received: by 10.103.76.10 with SMTP id d10mr1797061mul.9.1250589237359; Tue, 18 Aug 2009 02:53:57 -0700 (PDT) Date: Tue, 18 Aug 2009 12:53:57 +0300 Message-ID: <9e20d71e0908180253x4a11114cxc3e2c4af8798878@mail.gmail.com> From: Artis Caune To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: shell power in rc.conf 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: Tue, 18 Aug 2009 10:24:50 -0000 Hi, Is there any reason of not using shell variables in rc.conf? I want to tune rc.conf for easy editing and administration. Take for example jail_list or cloned_interfaces with 10+ entries: # interfaces cloned_interfaces="carp1 bce0.10 carp10 bce0.20 carp20" ifconfig_bce0_10="10.0.0.1/24" ifconfig_bce0_20="10.0.1.1/24" ifconfig_bce0_20_alias0="10.0.1.2/32" ifconfig_carp10="vhid 10 advskew 100 pass MySecret 10.0.0.100/32" ifconfig_carp20="vhid 20 advskew 15 pass MySecret 10.0.1.100/32" # jails jail_list="ns mail" jail_ns_hostname="ns" jail_ns_ip="10.10.10.1" jail_mail_hostname="mail" jail_mail_ip="10.10.10.2" Instead I can rewrite this to: # interfaces cloned_interfaces="${cloned_interfaces} bce0.10" ifconfig_bce0_10="10.0.0.1/24" cloned_interfaces="${cloned_interfaces} bce0.20" ifconfig_bce0_20="10.0.1.1/24" ifconfig_bce0_20_alias0="10.0.1.2/32" cloned_interfaces="${cloned_interfaces} carp10" ifconfig_carp10="vhid 10 advskew 100 pass MySecret 10.0.0.100/32" cloned_interfaces="${cloned_interfaces} carp20" ifconfig_carp20="vhid 20 advskew 15 pass MySecret 10.0.1.100/32" # jails jail_list="${jail_list} ns" jail_ns_hostname="ns" jail_ns_ip="10.10.10.1" jail_list="${jail_list} mail" jail_mail_hostname="mail" jail_mail_ip="10.10.10.2" Now I can just comment out unused interface or jail, and it won't start up. -- Artis Caune Everything should be made as simple as possible, but not simpler.