From 86e7b3d20ce0bd93bb8ee49534bf981783f7c734 Mon Sep 17 00:00:00 2001 From: alarig Date: Mon, 4 Feb 2019 11:01:07 +0100 Subject: [PATCH] Handle bird error --- check_bird2_oneshot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_bird2_oneshot b/check_bird2_oneshot index 737d433..9f36012 100755 --- a/check_bird2_oneshot +++ b/check_bird2_oneshot @@ -94,7 +94,7 @@ DIR="$(mktemp -d '/tmp/nrpe-bird.XXXX')" # The sed removes the first two lines (BIRD 2.0.2 ready and Name Proto blah) birdc 'show protocols all' 2>${DIR}/bird-err | sed '1,2d;$d' | \ awk -v RS= -v DIR=$DIR '{print > (DIR "/" $1 ".txt")}' -if [ $(cat ${DIR}/bird-err) != '' ]; then +if [ "$(cat ${DIR}/bird-err)" != '' ]; then printf "ERROR: $(cat ${DIR}/bird-err)\n" rm -r ${DIR} exit 2