Exit with error if the BGP community AS translation isn’t found

Signed-off-by: Alarig Le Lay <alelay@scaleway.com>
This commit is contained in:
Alarig Le Lay 2024-10-17 15:28:46 +02:00
parent 0070ef25c4
commit 7dc53046f8
No known key found for this signature in database
GPG key ID: 948D6BC249D8EBFF

View file

@ -84,7 +84,12 @@ mkdir -p "${BIRD_CONF_PATH}"/functions
if [ "${PEER_AS}" -gt 65535 ]; then if [ "${PEER_AS}" -gt 65535 ]; then
# la t'es bien # la t'es bien
eval $(whois AS47214 | awk '/AS32 to AS16/ { print "AS"$5"="$7";" }' | sed -E 's/AS([0-9]+)/\1/g') eval $(whois AS47214 | awk '/AS32 to AS16/ { print "AS"$5"="$7";" }' | sed -E 's/AS([0-9]+)/\1/g')
if [ -n "${PEER_AS}" ]; then
eval COMMU_PEER_AS=\$AS${PEER_AS} eval COMMU_PEER_AS=\$AS${PEER_AS}
else
echo "AS16 - AS32 from whois AS${IXP_ASN} not found"
exit 1
fi
else else
COMMU_PEER_AS=${PEER_AS} COMMU_PEER_AS=${PEER_AS}
fi fi