diff options
author | dougb <dougb@FreeBSD.org> | 2002-03-17 20:14:11 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2002-03-17 20:14:11 +0000 |
commit | ffa228092d8f802a7033232a2fd2729576431d6b (patch) | |
tree | f7138699f813eeaef053897d02a89ef59ec66f51 /etc/rc.d/sysctl | |
parent | 02b4c46fb1f879af2191c83af47b3d005d8393cb (diff) | |
download | FreeBSD-src-ffa228092d8f802a7033232a2fd2729576431d6b.zip FreeBSD-src-ffa228092d8f802a7033232a2fd2729576431d6b.tar.gz |
Distinguish between first and last passes of rc.sysctl, and only set
mibs whose values are not already what is specified in sysctl.conf.
Diffstat (limited to 'etc/rc.d/sysctl')
-rw-r--r-- | etc/rc.d/sysctl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl index bedddb6..1e315f2 100644 --- a/etc/rc.d/sysctl +++ b/etc/rc.d/sysctl @@ -38,7 +38,23 @@ if [ -f /etc/sysctl.conf ]; then \#*|'') ;; *) - sysctl ${var} + mib=${var%=*} + val=${var#*=} + + if current_value=`sysctl -n ${mib} 2>/dev/null`; then + case ${current_value} in + ${val}) ;; + *) + sysctl ${var} + ;; + esac + else + case ${1} in + last) + echo "Warning: sysctl ${mib} does not exist" + ;; + esac + fi ;; esac done < /etc/sysctl.conf |