From 7dc53046f860b1ff913019234a2fa7c2ea1b2be5 Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Thu, 17 Oct 2024 15:28:46 +0200 Subject: [PATCH] =?UTF-8?q?Exit=20with=20error=20if=20the=20BGP=20communit?= =?UTF-8?q?y=20AS=20translation=20isn=E2=80=99t=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alarig Le Lay --- generate-irr-filter.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generate-irr-filter.sh b/generate-irr-filter.sh index 1f88ea4..0f60c72 100755 --- a/generate-irr-filter.sh +++ b/generate-irr-filter.sh @@ -84,7 +84,12 @@ mkdir -p "${BIRD_CONF_PATH}"/functions if [ "${PEER_AS}" -gt 65535 ]; then # la t'es bien eval $(whois AS47214 | awk '/AS32 to AS16/ { print "AS"$5"="$7";" }' | sed -E 's/AS([0-9]+)/\1/g') - eval COMMU_PEER_AS=\$AS${PEER_AS} + if [ -n "${PEER_AS}" ]; then + eval COMMU_PEER_AS=\$AS${PEER_AS} + else + echo "AS16 - AS32 from whois AS${IXP_ASN} not found" + exit 1 + fi else COMMU_PEER_AS=${PEER_AS} fi