2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-24 12:10:25 +00:00

Add dns to install nic

This commit is contained in:
cxhong
2020-06-30 16:57:52 -04:00
parent 8717e15804
commit 754af5ce39

View File

@@ -524,6 +524,7 @@ elif [ "$1" = "-s" ];then
str_inst_mask=''
str_inst_gateway=''
str_inst_mtu=''
str_inst_dns=''
if [ "$str_os_type" = "aix" ];then
log_error "configeth on $NODE: aix does not support -s flag"
exit 1
@@ -578,6 +579,7 @@ elif [ "$1" = "-s" ];then
str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'`
str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`
str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`
str_inst_dns=`grep domain-name-servers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'`
else
if [ -n "$MACADDRESS" ];then
str_inst_mac=$MACADDRESS
@@ -734,6 +736,11 @@ elif [ "$1" = "-s" ];then
if [ $networkmanager_active -eq 2 ]; then
echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file
fi
if [ -n "${str_inst_dns}" ];then
if [ $networkmanager_active -eq 1 ]; then
nmcli con modify $con_name ipv4.dns ${str_inst_dns}
fi
fi
if [ -n "${str_inst_mtu}" ];then
if [ $networkmanager_active -eq 1 ]; then
nmcli con modify $con_name mtu ${str_inst_mtu}