[fix] Set MSRVIP variable before hosts file is overwritten

This commit is contained in:
William Wernert
2020-11-05 13:38:08 -05:00
parent 915aaf58f2
commit b27b2e358b
2 changed files with 2 additions and 6 deletions

View File

@@ -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() {

View File

@@ -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
}