summaryrefslogtreecommitdiff
path: root/etc/rc.d/sysctl
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2002-03-17 20:14:11 +0000
committerDoug Barton <dougb@FreeBSD.org>2002-03-17 20:14:11 +0000
commitc84f8c0e1788e3d4765e26f4bc1ac55a7a0fb5b2 (patch)
treef7138699f813eeaef053897d02a89ef59ec66f51 /etc/rc.d/sysctl
parent6de2a2e8a5ecc812a85e5933d42ce57fecd9a922 (diff)
Notes
Diffstat (limited to 'etc/rc.d/sysctl')
-rw-r--r--etc/rc.d/sysctl18
1 files changed, 17 insertions, 1 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl
index bedddb636697..1e315f2eb239 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