From 752d0cc3af851c69a7be2d95e57067e09f288cac Mon Sep 17 00:00:00 2001 From: Kaladin Light <0.kaladin@gmail.com> Date: Sun, 5 Feb 2017 14:30:31 -0500 Subject: [PATCH] Leave the loop once we match --- scripts/makeOVPN.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/makeOVPN.sh b/scripts/makeOVPN.sh index 72e5fb8..db15efe 100644 --- a/scripts/makeOVPN.sh +++ b/scripts/makeOVPN.sh @@ -86,10 +86,11 @@ fi while read -r line || [ -n "${line}" ]; do STATUS=$(echo "$line" | awk '{print $1}') - if [[ "${STATUS}" = "V" ]]; then + if [ "${STATUS}" == "V" ]; then CERT=$(echo "$line" | sed -e 's:.*/CN=::') if [ "${CERT}" == "${NAME}" ]; then INUSE="1" + break fi fi done <${INDEX}