diff --git a/check_pf_gw_status b/check_pf_gw_status index f62a42b..6a1f0b5 100644 --- a/check_pf_gw_status +++ b/check_pf_gw_status @@ -68,7 +68,7 @@ fi wrtt=$(printf "%0.3f" "$wrtt") crtt=$(printf "%0.3f" "$crtt") -STAT=$($GWSTATUSCMD | grep $gwname | sed -E -e 's/[[:blank:]]+/,/g' -e 's/ms//g' -e 's/%//g') +STAT=$($GWSTATUSCMD | grep "^${gwname}\s" | sed -E -e 's/[[:blank:]]+/,/g' -e 's/ms//g' -e 's/%//g') if [ -z "$STAT" ]; then echo -n "Gateway with name '${gwname}' does not exist, possible values are: " listgw | xargs