summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/sysctl
diff options
context:
space:
mode:
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 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
OpenPOWER on IntegriCloud