summaryrefslogtreecommitdiff
path: root/arch-sysctl
blob: 4856df69ea3457ab75662d68e27f9842e0b41f84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# /usr/lib/initscripts/arch-sysctl
#
# Load sysctl configuration files following
# http://0pointer.de/public/systemd-man/sysctl.d.html
#

shopt -s nullglob

declare -a sysctl_d=(
	/usr/lib/sysctl.d/*.conf
	/etc/sysctl.d/*.conf
	/run/sysctl.d/*.conf
	/etc/sysctl.conf
)
declare -A fragments

# files declared later in the sysctl_d array will override earlier
# Example: `/etc/sysctl.d/foo.conf' supersedes `/usr/lib/sysctl.d/foo.conf'.
for path in "${sysctl_d[@]}"; do
  [[ -f $path ]] && fragments[${path##*/}]=$path
done

for path in "${fragments[@]}"; do
	sysctl -q -p "$path"
done

# vim: set ts=2 sw=2 noet: