Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/mount_portal/examples Added sysctl examples (read-only ...
details: https://anonhg.NetBSD.org/src/rev/d130f144c2c4
branches: trunk
changeset: 480655:d130f144c2c4
user: bgrayson <bgrayson%NetBSD.org@localhost>
date: Mon Jan 17 07:22:45 2000 +0000
description:
Added sysctl examples (read-only sysctls for now)
diffstat:
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(+), 0 deletions(-)
diffs (56 lines):
diff -r 9017d6ae7cd5 -r d130f144c2c4 sbin/mount_portal/examples/advanced.1
--- a/sbin/mount_portal/examples/advanced.1 Mon Jan 17 07:21:54 2000 +0000
+++ b/sbin/mount_portal/examples/advanced.1 Mon Jan 17 07:22:45 2000 +0000
@@ -86,3 +86,25 @@
# 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 -r 9017d6ae7cd5 -r d130f144c2c4 sbin/mount_portal/examples/advanced.1.conf
--- a/sbin/mount_portal/examples/advanced.1.conf Mon Jan 17 07:21:54 2000 +0000
+++ b/sbin/mount_portal/examples/advanced.1.conf Mon Jan 17 07:22:45 2000 +0000
@@ -16,3 +16,4 @@
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 -r 9017d6ae7cd5 -r d130f144c2c4 sbin/mount_portal/examples/sysctlfs.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sbin/mount_portal/examples/sysctlfs.sh Mon Jan 17 07:22:45 2000 +0000
@@ -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@localhost) 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 " = <val>", strip out the " = " also.
+ sysctl $path | sed -e "s/$path//;s/^\.//;s/^ = //"
+done
Home |
Main Index |
Thread Index |
Old Index