Browse Source

disable systemd-resolved for server

main
pvincent 10 months ago
parent
commit
abf8cac050
  1. 8
      lib/install.sh
  2. 4
      scripts/miaou

8
lib/install.sh

@ -354,6 +354,14 @@ function miaou_resolver() {
echo "miaou-resolver in NetworkManager dispatcher already initialized!"
fi
else
if sudo systemctl is-enabled systemd-resolved.service --quiet; then
echo -n "disabling systemd-resolved..."
sudo systemctl stop systemd-resolved.service --quiet
sudo systemctl disable systemd-resolved.service --quiet
sudo rm /etc/resolv.conf
PREFIX="" echoinfo DONE
fi
if ! grep -q "nameserver $bridge" /etc/resolv.conf; then
echo -n "customize resolv.conf from scratch with bridge=<$bridge>, gatewary=<$gateway> ..."
sudo tee /etc/resolv.conf &>/dev/null <<EOF

4
scripts/miaou

@ -372,8 +372,8 @@ function check_resolv_conf() {
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>"
resolver=$(grep nameserver /etc/resolv.conf | head -n1 | cut -d ' ' -f2)
PREFIX="resolver:check" echo "first resolver is <$resolver>"
[[ "$bridge_gw" != "$resolver" ]] && return 21
return 0

Loading…
Cancel
Save