forked from ungleich-public/cdist
		
	[type/__sysctl] Fix on NetBSD
This commit is contained in:
		
					parent
					
						
							
								8b53f35ffa
							
						
					
				
			
			
				commit
				
					
						3a87a447d0
					
				
			
		
					 3 changed files with 16 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,6 +44,8 @@ case "$os" in
 | 
			
		|||
      flag='-w'
 | 
			
		||||
      ;;
 | 
			
		||||
   netbsd)
 | 
			
		||||
      # shellcheck disable=SC2016
 | 
			
		||||
      echo 'PATH=$(getconf PATH)'
 | 
			
		||||
      flag='-w'
 | 
			
		||||
      ;;
 | 
			
		||||
   freebsd|openbsd)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
-------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue