Merge pull request #11 from johanthoren/master

Fix issue with grep matching on substring
This commit is contained in:
Dallas 2024-05-13 05:28:31 -05:00 committed by GitHub
commit 6346b1f7cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,7 +68,7 @@ fi
wrtt=$(printf "%0.3f" "$wrtt") wrtt=$(printf "%0.3f" "$wrtt")
crtt=$(printf "%0.3f" "$crtt") 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 if [ -z "$STAT" ]; then
echo -n "Gateway with name '${gwname}' does not exist, possible values are: " echo -n "Gateway with name '${gwname}' does not exist, possible values are: "
listgw | xargs listgw | xargs