Update removeOVPN.sh

This commit allows PiVPN scripts to revoke certificates with common names like "José" better. Prior to this commit, names like "José" could not be revoked using PiVPN tools.
This commit is contained in:
Douglas Orend 2020-10-20 11:00:35 -05:00 committed by GitHub
parent 5d2761b94b
commit 22cb5ee0ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,7 @@ if [[ -z "${CERTS_TO_REVOKE}" ]]; then
NAME=$(echo "$line" | sed -e 's:.*/CN=::') NAME=$(echo "$line" | sed -e 's:.*/CN=::')
if [ "$i" != 0 ]; then if [ "$i" != 0 ]; then
# Prevent printing "server" certificate # Prevent printing "server" certificate
CERTS[$i]=${NAME} CERTS[$i]=$(echo -e "${NAME}")
fi fi
let i=i+1 let i=i+1
fi fi
@ -102,7 +102,7 @@ else
while read -r line || [ -n "$line" ]; do while read -r line || [ -n "$line" ]; do
STATUS=$(echo "$line" | awk '{print $1}') STATUS=$(echo "$line" | awk '{print $1}')
if [[ "${STATUS}" = "V" ]]; then if [[ "${STATUS}" = "V" ]]; then
NAME=$(echo "$line" | sed -e 's:.*/CN=::') NAME=$(echo -e "$line" | sed -e 's:.*/CN=::')
CERTS[$i]=${NAME} CERTS[$i]=${NAME}
let i=i+1 let i=i+1
fi fi