From b27b2e358b3bef423e6b1566c9efe738d1d527dd Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 5 Nov 2020 13:38:08 -0500 Subject: [PATCH] [fix] Set MSRVIP variable before hosts file is overwritten --- setup/so-functions | 6 ------ setup/so-whiptail | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 87ba2f922..a0ac5bac6 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -105,14 +105,8 @@ add_manager_hostfile() { whiptail_check_exitstatus $exitstatus } - add_mngr_ip_to_hosts() { - if [[ -z "$MSRVIP" ]]; then - MSRVIP=getent hosts "$MSRV" | awk 'NR==1{print $1}' - fi - echo "$MSRVIP $MSRV" >> /etc/hosts - } addtotab_generate_templates() { diff --git a/setup/so-whiptail b/setup/so-whiptail index cc37f0545..20682a8b5 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -791,6 +791,8 @@ whiptail_management_server() { if ! getent hosts "$MSRV"; then add_manager_hostfile + else + MSRVIP=$(getent hosts "$MSRV" | awk 'NR==1{print $1}') fi }