From owner-freebsd-questions@FreeBSD.ORG Fri Mar 31 12:39:19 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 633F816A400 for ; Fri, 31 Mar 2006 12:39:19 +0000 (UTC) (envelope-from franshaarman@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0CA943D45 for ; Fri, 31 Mar 2006 12:39:18 +0000 (GMT) (envelope-from franshaarman@gmail.com) Received: by xproxy.gmail.com with SMTP id s9so442547wxc for ; Fri, 31 Mar 2006 04:39:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=GhwasMr5baYgK5dfRs77OxMTmDwOQio5OoDootMosFXsyCR6aqR+/V+9p6vZjDCxgEswSdON8/kHo3YmGqdII56jmw+KQf8+0Gu1Q6nQIoDuwFwT3M3KUm3CrJZDSQMS3OSGruagu+zR2lpnW+7xSfUel6havz9F1P4yme9CiMM= Received: by 10.70.122.20 with SMTP id u20mr394260wxc; Fri, 31 Mar 2006 04:39:17 -0800 (PST) Received: by 10.70.98.5 with HTTP; Fri, 31 Mar 2006 04:39:17 -0800 (PST) Message-ID: Date: Fri, 31 Mar 2006 14:39:17 +0200 From: "Frans Haarman" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: rcng, addition to rc.subr 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: Fri, 31 Mar 2006 12:39:19 -0000 I am changing /etc/rc.subr. I can now use rc.env.d directories. Each file i= n the directory becomes a variable. somewhat like daemontools envdir. It seemed nice to include it to rcng. So with this we can do: echo 'yes' > rc.env.d/sshd/sshd_enable Am concidering adding the "$_command' name to the variables if there is no _ in the file name. Then we could do: echo yes > rc.env.d/sshd/enable Here is the script: #custom rc.env.d #used to overide/configure last variables using rc.env.d if [ -d /data/etc/rc.env.d/"$_command" ]; then =09debug "rc.env.d /data/etc/rc.env.d/${_command}" =09envd_vars=3D`ls /data/etc/rc.env.d/"${_command}"`=09#each file is a var =09for envd_file in $envd_vars =09do =09=09if [ -f /data/etc/rc.env.d/"$_command"/$envd_file ]; then =09=09 export $envd_file=3D`head -1 /data/etc/rc.env.d/${_command}"/$envd_= file` =09=09fi =09done =09#echo "rc.env.d /data/etc/rc.env.d/${_command}" fi Does this look ok to you ? Regards, Frans