[sysadmin-bin] Make sure the transform happens directly on the original array so that dupes get caught properly



commit 5904fb8667173c82bdbfb33d10e2f308f90e9c47
Author: Andrea Veri <averi redhat com>
Date:   Fri Mar 30 17:59:08 2018 +0200

    Make sure the transform happens directly on the original array so that dupes get caught properly

 letsencrypt/letsencrypt_dns_del.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/letsencrypt/letsencrypt_dns_del.sh b/letsencrypt/letsencrypt_dns_del.sh
index bdd8a45..b84b035 100755
--- a/letsencrypt/letsencrypt_dns_del.sh
+++ b/letsencrypt/letsencrypt_dns_del.sh
@@ -3,7 +3,7 @@
 domain=$1
 token=$2
 sans=${SANS//,/ }
-sortedsans=(`for i in ${sans[@]}; do echo $i ; done | sort | uniq`)
+sortedsans=(`for i in ${sans[@]/\*\./ }; do echo $i ; done | sort | uniq`)
 arraylen=${#sortedsans[@]}
 
 cd /tmp
@@ -32,7 +32,7 @@ if [ -d /tmp/dns ]; then
     git commit --author="Let's Encrypt <gnome-sysadmin gnome org>" -a -m "Let's Encrypt Token has been 
deleted: ${domain}"
     git push
  
-    if [[ "${sortedsans[${arraylen} - 1]//\*./}" == "${domain}" ]]; then
+    if [[ "${sortedsans[${arraylen} - 1]}" == "${domain}" ]]; then
         ./do-domains > /dev/null 2>&1
         if [[ "$?" -eq 0 ]]; then
             git commit --author "Let's Encrypt <gnome-sysadmin gnome org>" -a -m "Let's Encrypt Token has 
been deleted: ${domain} (do-domains)"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]