From 64db8d6519d9593c5e06489529d988c16f7c0402 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Tue, 21 May 2024 08:55:11 +0200 Subject: [PATCH] fix: add route checking to network fix script (#975) * fix: add route checking to network fix script * bump ver --- .../systemd-networkd-check-and-fix.sh | 11 ++++++++++- common.vars.pkr.hcl | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.sh b/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.sh index c7218813e..af00b412b 100644 --- a/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.sh +++ b/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.sh @@ -6,6 +6,15 @@ journalctl --no-pager --unit systemd-networkd --since "1 minutes ago" --grep "Co NDISC_ERROR=$? if systemctl is-active --quiet systemd-networkd.service && [ "${NDISC_ERROR}" == 0 ]; then - echo "$(date) systemd-network running but NDisc routes are broken. Restarting systemd.networkd.system" + echo "$(date) systemd-network running but NDisc routes are broken. Restarting systemd.networkd.service" + /usr/bin/systemctl restart systemd-networkd.service + exit # no need to check further +fi + +# check for routes +ROUTES=$(ip -6 route list) + +if ! echo "${ROUTES}" | grep default >/dev/null || ! echo "${ROUTES}" | grep "::1 dev lo">/dev/null; then + echo "IPv6 routing table messed up. Restarting systemd.networkd.service" /usr/bin/systemctl restart systemd-networkd.service fi diff --git a/common.vars.pkr.hcl b/common.vars.pkr.hcl index c8bd8c2f1..3122dafcc 100644 --- a/common.vars.pkr.hcl +++ b/common.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.1.1.52" +postgres-version = "15.1.1.53"