mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Refactor ssh port forwarding
This commit is contained in:
		
							parent
							
								
									f7bcd3ccf5
								
							
						
					
					
						commit
						29e4922e6e
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		
							
								
								
									
										10
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -388,11 +388,11 @@ function vm_boot() { | ||||||
|   local NET="user,hostname=${VMNAME}" |   local NET="user,hostname=${VMNAME}" | ||||||
| 
 | 
 | ||||||
|   # Find a free port to expose ssh to the guest |   # Find a free port to expose ssh to the guest | ||||||
|   local PORT="" |   local SSH_PORT="" | ||||||
|   PORT=$(get_port 22220 9) |   SSH_PORT=$(get_port 22220 9) | ||||||
|   if [ -n "${PORT}" ]; then |   if [ -n "${SSH_PORT}" ]; then | ||||||
|     NET="${NET},hostfwd=tcp::${PORT}-:22" |     NET="${NET},hostfwd=tcp::${SSH_PORT}-:22" | ||||||
|     echo " - ssh:      ${PORT}/tcp is connected. Login via 'ssh user@localhost -p ${PORT}'" |     echo " - ssh:      ${SSH_PORT}/tcp is connected. Login via 'ssh user@localhost -p ${SSH_PORT}'" | ||||||
|   else |   else | ||||||
|     echo " - ssh:      All ports for exposing ssh have been exhausted." |     echo " - ssh:      All ports for exposing ssh have been exhausted." | ||||||
|   fi |   fi | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue