From 915aaf58f2bf6856c446211e4e8cae115b85a9b7 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 5 Nov 2020 13:28:21 -0500 Subject: [PATCH] [fix] Always set MSRVIP because /etc/hosts is wiped --- setup/so-functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index f764071cc..87ba2f922 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -107,9 +107,12 @@ add_manager_hostfile() { add_mngr_ip_to_hosts() { - if [[ -n "$MSRVIP" ]]; then - echo "$MSRVIP $MSRV" >> /etc/hosts + if [[ -z "$MSRVIP" ]]; then + MSRVIP=getent hosts "$MSRV" | awk 'NR==1{print $1}' fi + + echo "$MSRVIP $MSRV" >> /etc/hosts + } addtotab_generate_templates() {