启动了docker容器,网卡较多。
只需要获取hostname对应的ip:

local_host="`hostname --fqdn`"
ServiceIP=`nslookup -sil $local_host 2>/dev/null | grep Address: | sed '1d' | sed 's/Address://g'`
echo ${ServiceIP}

相关文章:

  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-09-04
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案