Date: Sat, 8 Jan 2005 21:36:07 -0500 From: Craig Rodrigues <rodrigc@crodrigues.org> To: Kris Kennaway <kris@obsecurity.org> Cc: freebsd-ports@freebsd.org Subject: Re: Hack to sysctl kern.osreldate, for ports cluster Message-ID: <20050109023607.GA5290@crodrigues.org> In-Reply-To: <20050108202048.GA84451@xor.obsecurity.org> References: <20050108071324.GA32371@crodrigues.org> <20050108034714.40f42462@dolphin.local.net> <20050108185044.GA57045@crodrigues.org> <20050108192135.GD8265@odin.ac.hmc.edu> <20050108201059.GA4161@crodrigues.org> <20050108202048.GA84451@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 08, 2005 at 12:20:48PM -0800, Kris Kennaway wrote: > I think I'd prefer to use a shell script wrapper around the real > sysctl than to maintain local patches in every source tree I carry > around. It's easier to hack the sysctl binary itself, but I understand your concern. How about something like this: #!/bin/sh SYSCTL=/sbin/sysctl for ARG in $@ do if [ "$ARG" = "kern.osreldate" ] then KERN_OSRELDATE=1 elif [ "$ARG" = "-n" ] then NUMERIC=1 fi done if [ ! -z "$KERN_OSRELDATE" ] then if [ -z "$NUMERIC" ] then printf "kern.osreldate: " fi awk '/^#define __FreeBSD_version/ {print $3}' /usr/include/sys/param.h exit 0 fi $SYSCTL $@ return $? -- Craig Rodrigues rodrigc@crodrigues.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050109023607.GA5290>