resolver gateway tail instead of head

This commit is contained in:
pvincent
2024-03-02 16:45:33 +04:00
parent 701db3c3e8
commit cda020f4e0
5 changed files with 27 additions and 16 deletions
+5 -3
View File
@@ -368,11 +368,13 @@ function prepare_dmz_container() {
function check_resolv_conf() {
local bridge_gw resolver
bridge_gw=$(lxc network get lxdbr0 ipv4.address | cut -d'/' -f1)
resolver=$(grep nameserver /etc/resolv.conf | head -n1 | cut -d ' ' -f2)
PREFIX="resolver:check" echo "container resolver is <$resolver>"
bridge_gw=$(lxc network get lxdbr0 ipv4.address | cut -d'/' -f1)
PREFIX="resolver:check" echo "container bridge is <$bridge_gw>"
resolver=$(grep nameserver /etc/resolv.conf | tail -n1 | cut -d ' ' -f2)
PREFIX="resolver:check" echo "container resolver is <$resolver>"
[[ "$bridge_gw" != "$resolver" ]] && return 21
return 0
}