2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-27 08:25:52 +00:00

fix for multiply nameservers in /var/run/NetworkManager/resolv.conf

This commit is contained in:
sgr
2024-08-15 14:46:05 +02:00
committed by Markus Hilger
parent 1534231ae7
commit 10713bfc6e

View File

@ -630,7 +630,7 @@ elif [ "$1" = "-s" ];then
str_inst_gateway=`ip ro ls|grep default|awk '{print $3}'|head -1`
str_resolv_file=/var/run/NetworkManager/resolv.conf
if [ -f $str_resolv_file ];then
str_inst_dns=`grep ^nameserver $str_resolv_file | sed 's/^nameserver //g'`
str_inst_dns=`grep ^nameserver $str_resolv_file | sed 's/^nameserver //g' | sed ':a;N;$!ba;s/\n/,/g'`
str_inst_dns_search=`grep ^search $str_resolv_file | sed 's/^search //g'`
fi
fi