mirror of https://github.com/easzlab/kubeasz.git
fix:多条默认路由网卡自动识别问题
parent
d2a83d06a0
commit
e0b1c400df
2
ezctl
2
ezctl
|
@ -411,7 +411,7 @@ function start-aio(){
|
|||
# Check ENV 'HOST_IP', exists if the CMD 'ezctl' running in a docker container
|
||||
if [[ -z $HOST_IP ]];then
|
||||
# ezctl runs in a host machine, get host's ip
|
||||
HOST_IF=$(ip route|grep default|cut -d' ' -f5)
|
||||
HOST_IF=$(ip route|grep default|head -n1|cut -d' ' -f5)
|
||||
HOST_IP=$(ip a|grep "$HOST_IF$"|head -n1|awk '{print $2}'|cut -d'/' -f1)
|
||||
fi
|
||||
set -u
|
||||
|
|
4
ezdown
4
ezdown
|
@ -327,8 +327,8 @@ function start_kubeasz_docker() {
|
|||
|
||||
logger info "try to run kubeasz in a container"
|
||||
# get host's IP
|
||||
host_if=$(ip route|grep default|cut -d' ' -f5)
|
||||
host_ip=$(ip a|grep "$host_if$"|awk '{print $2}'|cut -d'/' -f1)
|
||||
host_if=$(ip route|grep default|head -n1|cut -d' ' -f5)
|
||||
host_ip=$(ip a|grep "$host_if$"|head -n1|awk '{print $2}'|cut -d'/' -f1)
|
||||
logger debug "get host IP: $host_ip"
|
||||
|
||||
# allow ssh login using key locally
|
||||
|
|
Loading…
Reference in New Issue