mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	during wait for boot, also wait until vm has an ip address
This commit is contained in:
		
							parent
							
								
									2e0b37a09a
								
							
						
					
					
						commit
						4fedfb377d
					
				@ -201,7 +201,25 @@ lx_wait_for_boot() {
 | 
			
		||||
    echo ""
 | 
			
		||||
    echo -n "Wait for cloud-init "
 | 
			
		||||
    lxc --project "$project" exec "$inst" -- cloud-init status --wait
 | 
			
		||||
    local rc=$?
 | 
			
		||||
    
 | 
			
		||||
    if [ $rc -eq 0 ]; then
 | 
			
		||||
        echo "Wait for ip address "
 | 
			
		||||
        local ip=""
 | 
			
		||||
        local count=0
 | 
			
		||||
        while [ $count -lt 10 ]; do
 | 
			
		||||
            let count+=1
 | 
			
		||||
            ip="$(lxc --project "$project" exec "$inst" -- hostname -I | awk '{print $1}')"
 | 
			
		||||
            rc=$?
 | 
			
		||||
            echo "  [${count}] got: $ip"
 | 
			
		||||
            if [ $rc -ne 0 -o "$ip" != "" ];then
 | 
			
		||||
                break
 | 
			
		||||
            fi
 | 
			
		||||
            sleep 5
 | 
			
		||||
        done
 | 
			
		||||
    fi
 | 
			
		||||
    echo ""
 | 
			
		||||
    return $rc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lx_get_ssh_identity() {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user