Merge branch 'fix/type/__sysctl/netbsd-path' into 'master'

__sysctl: Fix on NetBSD

See merge request ungleich-public/cdist!918
This commit is contained in:
poljakowski 2020-07-27 15:30:57 +02:00
commit a5f25faf25
3 changed files with 16 additions and 2 deletions

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -e
#
# 2014 Steven Armstrong (steven-cdist at armstrong.cc)
#
@ -18,5 +18,10 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
if test "$(uname -s)" = NetBSD
then
PATH=$(getconf PATH)
fi
# get the current runtime value
sysctl -n "$__object_id" || true
sysctl -n "${__object_id}" || true

View file

@ -44,6 +44,8 @@ case "$os" in
flag='-w'
;;
netbsd)
# shellcheck disable=SC2016
echo 'PATH=$(getconf PATH)'
flag='-w'
;;
freebsd|openbsd)

View file

@ -26,6 +26,13 @@ EXAMPLES
__sysctl net.ipv4.ip_forward --value 1
# On some operating systems, e.g. NetBSD, to prevent an error if the
# MIB style name does not exist (e.g. optional kernel components),
# name and value can be separated by `?=`. The same effect can be achieved
# in cdist by appending a `?` to the key:
__sysctl ddb.onpanic? --value -1
AUTHORS
-------