ssm-services/services/sysctl
fbt faae8b8821 sysctl service
Signed-off-by: fbt <fbt@fleshless.org>
2017-12-21 18:06:33 +03:00

19 lines
383 B
Plaintext
Executable File

#!/usr/bin/env ssm
unset reload
service_type='oneshot'
service_command=( /usr/bin/sysctl -p )
pre_start() {
for i in /etc/sysctl.conf /etc/sysctl.d/* /usr/lib/sysctl.d/*; do
[[ -f "$i" ]] && sysctl_config_files+=( "$i" )
done
[[ "$sysctl_config_files" ]] || {
printf 'No configuration for sysctl found!\n'
return 3
}
service_command+=( "${sysctl_config_files[@]}" )
}