Add openvz/lxc discovery
This commit is contained in:
		
					parent
					
						
							
								24932fe891
							
						
					
				
			
			
				commit
				
					
						98160624a0
					
				
			
		
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
					@ -22,6 +22,17 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# FIXME: other system types (not linux ...)
 | 
					# FIXME: other system types (not linux ...)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -d "/proc/vz" -a ! -d "/proc/bc" ]; then
 | 
				
			||||||
 | 
					    echo openvz
 | 
				
			||||||
 | 
					    exit
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -e "/proc/1/environ" ] &&
 | 
				
			||||||
 | 
					    cat "/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container='; then
 | 
				
			||||||
 | 
					    echo lxc
 | 
				
			||||||
 | 
					    exit
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -r /proc/cpuinfo ]; then
 | 
					if [ -r /proc/cpuinfo ]; then
 | 
				
			||||||
    # this should only exist on virtual guest machines,
 | 
					    # this should only exist on virtual guest machines,
 | 
				
			||||||
    # tested on vmware, xen, kvm
 | 
					    # tested on vmware, xen, kvm
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue