From 5d2761b94be19f34cdbcf64c309944ea061e24eb Mon Sep 17 00:00:00 2001 From: Douglas Orend <43975081+xptsp@users.noreply.github.com> Date: Tue, 20 Oct 2020 10:57:28 -0500 Subject: [PATCH 1/2] Update listOVPN.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit allows PiVPN scripts to display certificates with common names like "José" better. Prior to this commit, names like "José" would be shown as "Jos\xC3\xA9". --- scripts/openvpn/listOVPN.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/openvpn/listOVPN.sh b/scripts/openvpn/listOVPN.sh index cd02790..6fba929 100755 --- a/scripts/openvpn/listOVPN.sh +++ b/scripts/openvpn/listOVPN.sh @@ -28,13 +28,13 @@ while read -r line || [ -n "$line" ]; do EXPD=$(echo "$line" | awk '{if (length($2) == 15) print $2; else print "20"$2}' | cut -b 1-8 | date +"%b %d %Y" -f -) if [ "${STATUS}" == "V" ]; then - printf "Valid \t %s \t %s\\n" "$NAME" "$EXPD" + printf "Valid \t %s \t %s\\n" "$(echo -e "$NAME")" "$EXPD" elif [ "${STATUS}" == "R" ]; then - printf "Revoked \t %s \t %s\\n" "$NAME" "$EXPD" + printf "Revoked \t %s \t %s\\n" "$(echo -e "$NAME")" "$EXPD" elif [ "${STATUS}" == "E" ]; then - printf "Expired \t %s \t %s\\n" "$NAME" "$EXPD" + printf "Expired \t %s \t %s\\n" "$(echo -e "$NAME")" "$EXPD" else - printf "Unknown \t %s \t %s\\n" "$NAME" "$EXPD" + printf "Unknown \t %s \t %s\\n" "$(echo -e "$NAME")" "$EXPD" fi done <${INDEX} From 22cb5ee0ef704c2ca5f068a0a0dd096cd4848fcc Mon Sep 17 00:00:00 2001 From: Douglas Orend <43975081+xptsp@users.noreply.github.com> Date: Tue, 20 Oct 2020 11:00:35 -0500 Subject: [PATCH 2/2] Update removeOVPN.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- scripts/openvpn/removeOVPN.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/openvpn/removeOVPN.sh b/scripts/openvpn/removeOVPN.sh index 30bfac7..a77333b 100755 --- a/scripts/openvpn/removeOVPN.sh +++ b/scripts/openvpn/removeOVPN.sh @@ -58,7 +58,7 @@ if [[ -z "${CERTS_TO_REVOKE}" ]]; then NAME=$(echo "$line" | sed -e 's:.*/CN=::') if [ "$i" != 0 ]; then # Prevent printing "server" certificate - CERTS[$i]=${NAME} + CERTS[$i]=$(echo -e "${NAME}") fi let i=i+1 fi @@ -102,7 +102,7 @@ else while read -r line || [ -n "$line" ]; do STATUS=$(echo "$line" | awk '{print $1}') if [[ "${STATUS}" = "V" ]]; then - NAME=$(echo "$line" | sed -e 's:.*/CN=::') + NAME=$(echo -e "$line" | sed -e 's:.*/CN=::') CERTS[$i]=${NAME} let i=i+1 fi