From 2a09ca64fd36a08752d04e7e64f24f24608bbf0d Mon Sep 17 00:00:00 2001 From: bgrayson Date: Mon, 17 Jan 2000 07:22:45 +0000 Subject: [PATCH] Added sysctl examples (read-only sysctls for now) --- sbin/mount_portal/examples/advanced.1 | 22 ++++++++++++++++++++++ sbin/mount_portal/examples/advanced.1.conf | 1 + sbin/mount_portal/examples/sysctlfs.sh | 15 +++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 sbin/mount_portal/examples/sysctlfs.sh diff --git a/sbin/mount_portal/examples/advanced.1 b/sbin/mount_portal/examples/advanced.1 index 6a0cc72ada0b..c503bcebdbbd 100644 --- a/sbin/mount_portal/examples/advanced.1 +++ b/sbin/mount_portal/examples/advanced.1 @@ -86,3 +86,25 @@ NoticeNoSlashHere # Or, rather than putting //, we can use the last nroff # configuration, nroff%, instead: % cat /p/nroff%/p/bzcat%/usr/share/man/man8/mount_portal.bz2 + +# Also, we can provide read-only 'sysctlfs' functionality. This +# is provided by the shell script sysctlfs.sh, which should be in +# /usr/share/examples/mount_portal. + +% cat /p/sysctl/kern.mbuf +msize = 128 +mclbytes = 2048 +nmbclusters = 512 +mblowat = 16 +mcllowat = 8 + +% cat /p/sysctl/kern/mbuf +msize = 128 +mclbytes = 2048 +nmbclusters = 512 +mblowat = 16 +mcllowat = 8 + +% cat /p/sysctl/kern/mbuf/msize +128 + diff --git a/sbin/mount_portal/examples/advanced.1.conf b/sbin/mount_portal/examples/advanced.1.conf index c61687c8989f..735b26780651 100644 --- a/sbin/mount_portal/examples/advanced.1.conf +++ b/sbin/mount_portal/examples/advanced.1.conf @@ -16,3 +16,4 @@ bzcat/ rfilter bzcat/ bzcat %s bzcat% rfilter bzcat% bzcat %s nroff/ rfilter nroff/ nroff -man %s nroff% rfilter nroff% nroff -man %s +sysctl/ rfilter sysctl/ /usr/share/examples/mount_portal/sysctlfs.sh %s diff --git a/sbin/mount_portal/examples/sysctlfs.sh b/sbin/mount_portal/examples/sysctlfs.sh new file mode 100644 index 000000000000..17f91e115caf --- /dev/null +++ b/sbin/mount_portal/examples/sysctlfs.sh @@ -0,0 +1,15 @@ +#!/bin/sh +## $NetBSD: sysctlfs.sh,v 1.1 2000/01/17 07:22:45 bgrayson Exp $ +## Fast hack at a sysctl filesystem. The path can be either in +## dot-style (kern.mbuf.msize) or in slash-style (kern/mbuf/msize). +## Hacked as an example by Brian Grayson (bgrayson@netbsd.org) in Sep 1999. +for path in $*; do + ## First, change any slashes into dots. + path=`echo $path | tr '/' '.'` + ## Now invoke sysctl, and post-process the output to make it + ## friendlier. In particular: + ## 1. Remove the leading prefix. + ## 2. Remove a now-leading ".", if any. + ## 3. If we are left with " = ", strip out the " = " also. + sysctl $path | sed -e "s/$path//;s/^\.//;s/^ = //" +done