Merge pull request #556 from uqam-fob/explorer-init-pgrep
explorer/init/Linux: use pgrep instead of ps
This commit is contained in:
		
				commit
				
					
						c6d00019a8
					
				
			
		
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
#!/bin/sh
 | 
					#!/bin/sh
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# 2016 Daniel Heule (hda at sfs.biz)
 | 
					# 2016 Daniel Heule (hda at sfs.biz)
 | 
				
			||||||
 | 
					# Copyright 2017, Philippe Gregoire <pg@pgregoire.xyz>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# This file is part of cdist.
 | 
					# This file is part of cdist.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
| 
						 | 
					@ -25,7 +26,10 @@
 | 
				
			||||||
uname_s="$(uname -s)"
 | 
					uname_s="$(uname -s)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$uname_s" in
 | 
					case "$uname_s" in
 | 
				
			||||||
    Linux|FreeBSD)
 | 
					    Linux)
 | 
				
			||||||
 | 
					        (pgrep -P0 -l | awk '/^1[ \t]/ {print $2;}') || true
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					    FreeBSD)
 | 
				
			||||||
        ps -o comm= -p 1 || true
 | 
					        ps -o comm= -p 1 || true
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    *)
 | 
					    *)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue