File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -580,6 +580,7 @@ elif [ "$1" = "-s" ];then
580
580
str_inst_mask=` grep subnet-mask $str_lease_file | tail -n 1 | awk ' {print $3}' | sed ' s/;$//' `
581
581
str_inst_gateway=` grep routers $str_lease_file | tail -n 1 | awk ' {print $3}' | sed ' s/;$//' `
582
582
str_inst_dns=` grep domain-name-servers $str_lease_file | tail -n 1 | awk ' {print $3}' | sed ' s/;$//' `
583
+ str_inst_dns_search=` grep domain-search $str_lease_file | tail -n 1 | awk ' {print $3}' | sed ' s/;$//' `
583
584
else
584
585
if [ -n " $MACADDRESS " ]; then
585
586
str_inst_mac=$MACADDRESS
@@ -594,6 +595,11 @@ elif [ "$1" = "-s" ];then
594
595
fi
595
596
fi
596
597
str_inst_gateway=` ip ro ls| grep default| awk ' {print $3}' | head -1`
598
+ str_resolv_file=/var/run/NetworkManager/resolv.conf
599
+ if [ -f $str_resolv_file ]; then
600
+ str_inst_dns=` grep ^nameserver $str_resolv_file | sed ' s/^nameserver //g' `
601
+ str_inst_dns_search=` grep ^search $str_resolv_file | sed ' s/^search //g' `
602
+ fi
597
603
fi
598
604
fi
599
605
fi
@@ -755,6 +761,11 @@ elif [ "$1" = "-s" ];then
755
761
nmcli con modify $con_name ipv4.dns ${str_inst_dns}
756
762
fi
757
763
fi
764
+ if [ -n " ${str_inst_dns_search} " ]; then
765
+ if [ $networkmanager_active -eq 1 ]; then
766
+ nmcli con modify $con_name ipv4.dns-search " ${str_inst_dns_search} "
767
+ fi
768
+ fi
758
769
if [ -n " ${str_inst_mtu} " ]; then
759
770
if [ $networkmanager_active -eq 1 ]; then
760
771
nmcli con modify $con_name mtu ${str_inst_mtu}
You can’t perform that action at this time.
0 commit comments