Merge pull request #731 from sideeffect42/sysctl-more-oses

Better OS support for __sysctl type
This commit is contained in:
Darko Poljak 2018-12-14 15:19:17 +01:00 committed by GitHub
commit 77d69c987d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 7 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
# #
# 2014 Steven Armstrong (steven-cdist at armstrong.cc) # 2014 Steven Armstrong (steven-cdist at armstrong.cc)
# 2018 Takashi Yoshi (takashi at yoshi.email)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -28,12 +29,26 @@ fi
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
case "$os" in case "$os" in
redhat|centos|ubuntu|debian|devuan|archlinux|coreos) # Linux
flag='-w' redhat|centos|ubuntu|debian|devuan|archlinux|gentoo|coreos)
;; flag='-w'
frebsd) ;;
flag='' # BusyBox
;; alpine|openwrt)
flag='-w'
;;
macosx)
# NOTE: Older versions of Mac OS X require the -w option.
# Even though the flag is not mentioned in new man pages anymore,
# it still works.
flag='-w'
;;
netbsd)
flag='-w'
;;
freebsd|openbsd)
flag=''
;;
esac esac
# set the current runtime value # set the current runtime value

View File

@ -1,6 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
# #
# 2014 Steven Armstrong (steven-cdist at armstrong.cc) # 2014 Steven Armstrong (steven-cdist at armstrong.cc)
# 2018 Takashi Yoshi (takashi at yoshi.email)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -22,7 +23,12 @@
os=$(cat "$__global/explorer/os") os=$(cat "$__global/explorer/os")
case "$os" in case "$os" in
redhat|centos|ubuntu|debian|devuan|archlinux|coreos|freebsd) # Linux
redhat|centos|ubuntu|debian|devuan|archlinux|coreos)
:
;;
# BSD
freebsd|macosx|netbsd|openbsd)
: :
;; ;;
*) *)