mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Round up host RAM. Closes #11
Avoid "integer expression expected" errors when host RAM enumeration returns a floating point value. * https://github.com/wimpysworld/quickemu/issues/11
This commit is contained in:
		
							parent
							
								
									fb082f1079
								
							
						
					
					
						commit
						142eac3001
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		
							
								
								
									
										2
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -199,6 +199,8 @@ function vm_boot() { | ||||||
| 
 | 
 | ||||||
|   local RAM_VM="2G" |   local RAM_VM="2G" | ||||||
|   local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g') |   local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g') | ||||||
|  |   #Round up - https://github.com/wimpysworld/quickemu/issues/11 | ||||||
|  |   RAM_HOST=$(printf '%.*f\n' 0 ${RAM_HOST}) | ||||||
|   if [ ${RAM_HOST} -ge 64 ]; then |   if [ ${RAM_HOST} -ge 64 ]; then | ||||||
|     RAM_VM="4G" |     RAM_VM="4G" | ||||||
|   elif [ ${RAM_HOST} -ge 16 ]; then |   elif [ ${RAM_HOST} -ge 16 ]; then | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue