summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/sysctl25
1 files changed, 15 insertions, 10 deletions
diff --git a/etc/rc.d/sysctl b/etc/rc.d/sysctl
index c55cc84..623956d 100755
--- a/etc/rc.d/sysctl
+++ b/etc/rc.d/sysctl
@@ -16,12 +16,12 @@ reload_cmd="sysctl_start"
lastload_cmd="sysctl_start last"
extra_commands="reload lastload"
-sysctl_start()
+#
+# Read in a file containing sysctl settings and set things accordingly.
+#
+parse_file()
{
- #
- # Read in /etc/sysctl.conf and set things accordingly
- #
- if [ -f /etc/sysctl.conf ]; then
+ if [ -f $1 ]; then
while read var comments
do
case ${var} in
@@ -36,19 +36,24 @@ sysctl_start()
${val})
;;
*)
- if ! sysctl "${var}" >/dev/null 2>&1; then
- warn "unable to set ${var}"
- fi
+ sysctl "${var}"
;;
esac
- elif [ "$1" = "last" ]; then
+ elif [ "$2" = "last" ]; then
warn "sysctl ${mib} does not exist."
fi
;;
esac
- done < /etc/sysctl.conf
+ done < $1
fi
}
+sysctl_start()
+{
+
+ parse_file /etc/sysctl.conf $1
+ parse_file /etc/sysctl.conf.local $1
+}
+
load_rc_config $name
run_rc_command "$1"
OpenPOWER on IntegriCloud